This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Fix/e2e tests #1640
Merged
Merged
Fix/e2e tests #1640
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6aa72f6
Use the saved ar locale file for playwright messages
obulat ae3f71b
Use playwright.sh instead of CI to move the locale files
obulat 36d7477
Add snapshots
obulat c10cd3e
Add snapshots
obulat 8233b8e
Copy valid-locales from test folder in setup-node-env
obulat e8eb44b
Copy all locale files from test folder in setup-node-env
obulat 879e658
Try fixing the container not exiting
obulat 0d9ea8b
Revert "Using wrong snapshots to fail tests"
obulat 3603e82
Revert changes that are added in a different PR
obulat bb81975
Try to speed up e2e tests
obulat 50a5414
Make all e2e tests run in parallel mode
obulat 089b043
Apply code review suggestions
obulat f06cb9f
Try failing a test
obulat 21907a6
Revert "Try failing a test"
obulat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+2.19 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-html-tab-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.19 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-html-tab-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10.8 KB
(150%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-html-tab-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.19 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-html-tab-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+228 Bytes
(100%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-html-tab-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.74 KB
(110%)
...omponents/media-reuse.spec.ts-snapshots/media-reuse-rtl-plain-tab-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.74 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-plain-tab-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.43 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-plain-tab-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.38 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-plain-tab-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.74 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-plain-tab-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.22 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-plain-tab-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.51 KB
(110%)
...components/media-reuse.spec.ts-snapshots/media-reuse-rtl-rich-tab-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.52 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-rich-tab-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.89 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-rich-tab-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.57 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-rich-tab-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.51 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-rich-tab-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.54 KB
(110%)
.../components/media-reuse.spec.ts-snapshots/media-reuse-rtl-rich-tab-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.16 KB
(100%)
...t/visual-regression/pages/pages.spec.ts-snapshots/meta-search-rtl-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.97 KB
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/meta-search-rtl-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.88 KB
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/meta-search-rtl-md-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5.68 KB
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/meta-search-rtl-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.54 KB
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/meta-search-rtl-xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.48 KB
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/meta-search-rtl-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.99 KB
(95%)
.../visual-regression/pages/pages.spec.ts-snapshots/non-existent-rtl-2xl-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.04 KB
(93%)
...t/visual-regression/pages/pages.spec.ts-snapshots/non-existent-rtl-lg-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.02 KB
(92%)
...t/visual-regression/pages/pages.spec.ts-snapshots/non-existent-rtl-md-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.48 KB
(87%)
...t/visual-regression/pages/pages.spec.ts-snapshots/non-existent-rtl-sm-linux.png
Oops, something went wrong.
Binary file modified
BIN
-2.11 KB
(94%)
...t/visual-regression/pages/pages.spec.ts-snapshots/non-existent-rtl-xl-linux.png
Oops, something went wrong.
Binary file modified
BIN
-3.57 KB
(82%)
...t/visual-regression/pages/pages.spec.ts-snapshots/non-existent-rtl-xs-linux.png
Oops, something went wrong.
Binary file modified
BIN
-580 Bytes
(99%)
...t/visual-regression/pages/pages.spec.ts-snapshots/search-help-rtl-2xl-linux.png
Oops, something went wrong.
Binary file modified
BIN
-420 Bytes
(99%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/search-help-rtl-lg-linux.png
Oops, something went wrong.
Binary file modified
BIN
-672 Bytes
(99%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/search-help-rtl-md-linux.png
Oops, something went wrong.
Binary file modified
BIN
+310 Bytes
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/search-help-rtl-sm-linux.png
Oops, something went wrong.
Binary file modified
BIN
-515 Bytes
(99%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/search-help-rtl-xl-linux.png
Oops, something went wrong.
Binary file modified
BIN
+301 Bytes
(100%)
...ht/visual-regression/pages/pages.spec.ts-snapshots/search-help-rtl-xs-linux.png
Oops, something went wrong.
Binary file modified
BIN
-5.67 KB
(99%)
...ght/visual-regression/pages/sources.spec.ts-snapshots/sources-rtl-2xl-linux.png
Oops, something went wrong.
Binary file modified
BIN
-4.2 KB
(99%)
...ight/visual-regression/pages/sources.spec.ts-snapshots/sources-rtl-lg-linux.png
Oops, something went wrong.
Binary file modified
BIN
-5 KB
(99%)
...ight/visual-regression/pages/sources.spec.ts-snapshots/sources-rtl-md-linux.png
Oops, something went wrong.
Binary file modified
BIN
-4.15 KB
(99%)
...ight/visual-regression/pages/sources.spec.ts-snapshots/sources-rtl-sm-linux.png
Oops, something went wrong.
Binary file modified
BIN
-5.45 KB
(99%)
...ight/visual-regression/pages/sources.spec.ts-snapshots/sources-rtl-xl-linux.png
Oops, something went wrong.
Binary file modified
BIN
-4.4 KB
(99%)
...ight/visual-regression/pages/sources.spec.ts-snapshots/sources-rtl-xs-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
meta: { | ||
createdAt: '2022-08-11T09:32:39.277Z', | ||
host: 'https://api.openverse.engineering', | ||
resHumanReadable: true, | ||
}, | ||
req: { | ||
headers: { | ||
connection: 'close', | ||
}, | ||
url: '/v1/auth_tokens/token/', | ||
method: 'POST', | ||
body: 'Y2xpZW50X2lkPVNCbzM1dU0wNDlvQ05ZdGtOVXdXYTZ3clFpdFF1dHNMMkZhWGo2VlkmY2xpZW50X3NlY3JldD0zVG80VzJGRXhPQnc5ZUdtbDc0Uzdib2M2c2ZUM0hFZ2xBY3VqUWdMbDBuQ0NZdUhYMThwcDRoQnEwc2ZNM2FzNkpIeDlkZG5odG5lenlYaGRYb0ZDN0JvQlZnakRheWM1OU8yUm9kclI0UkN5NnlBekRtcG91YlNOaktRaVhhbyZncmFudF90eXBlPWNsaWVudF9jcmVkZW50aWFscw==', | ||
}, | ||
res: { | ||
status: 401, | ||
headers: { | ||
date: [ | ||
'Thu, 11 Aug 2022 09:32:40 GMT', | ||
], | ||
'content-type': [ | ||
'application/json', | ||
], | ||
'content-length': [ | ||
'27', | ||
], | ||
connection: [ | ||
'close', | ||
], | ||
'cache-control': [ | ||
'no-store', | ||
], | ||
pragma: [ | ||
'no-cache', | ||
], | ||
'www-authenticate': [ | ||
'Bearer error="invalid_client"', | ||
], | ||
vary: [ | ||
'Authorization, Origin', | ||
], | ||
'x-frame-options': [ | ||
'DENY', | ||
], | ||
'x-content-type-options': [ | ||
'nosniff', | ||
], | ||
'referrer-policy': [ | ||
'same-origin', | ||
], | ||
'cross-origin-opener-policy': [ | ||
'same-origin', | ||
], | ||
'x-request-id': [ | ||
'e8610770b47d46b99e41b38b54600063', | ||
], | ||
'cf-cache-status': [ | ||
'DYNAMIC', | ||
], | ||
'expect-ct': [ | ||
'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', | ||
], | ||
'strict-transport-security': [ | ||
'max-age=15552000; includeSubDomains; preload', | ||
], | ||
server: [ | ||
'cloudflare', | ||
], | ||
'cf-ray': [ | ||
'738ff71b1876c223-VIE', | ||
], | ||
'alt-svc': [ | ||
'h3=":443"; ma=86400, h3-29=":443"; ma=86400', | ||
], | ||
}, | ||
body: { | ||
error: 'invalid_client', | ||
}, | ||
}, | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So was it the
docker-compose down
that was causing this not to fail because the script continued to thedc down
command after the failure of the test run? If so, an alternative fix (assuming thedown
is necessary) would be to addset -x
to the top of the script so that any command failure causes the script to exit with the failure exit code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if you remove the
dc down
line, the tests start to fail again. But I'm not very clear as to what exactly happens. I'll try your suggestion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that is the case then I think it is what I said. The default behavior with shell scripts is not to bail out the entire script if a command fails unless the
e
option is set.I had remembered it wrong, btw, it should be
set -e
.set -x
prints the commands as they're run.e
bails on the script if any error occurs. https://linuxcommand.org/lc3_man_pages/seth.htmlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked! Thank you :)
How did you see that the Docker container was still running after tests in GitHub actions, by the way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest using
docker-compose run --rm ...
instead but glad to see it's working now! :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why but
dc run
did not work for me when I tried it when originally developing the dockerized Playwright tests. There was something strange about it where it would never end the containers, IIRC.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
dc down
line was added to solve the problem where a Playwright container wouldn't stop, right? I have never known that it didn't stop in the CI. How did you understand that that was, indeed, happening?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @krysal added it (IIRC) upon noticing that the containers weren't stopping locally. I don't think it matters if the containers continue to run in CI, as far as I know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. The machines running the GH actions are a big black box, so that would have been much more difficult to identify, though locally it was a coincidence 🙂