Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front, scripts: add playwright container for e2e tests #9554

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

Synar
Copy link
Contributor

@Synar Synar commented Nov 4, 2024

Close #9505

Instead of simply expanding the readme as initially thought in the issue,
a dockerfile is added for the playwright container,
and a script is used to launch it with optional ui flags for x11 and wayland.

The wayland flag is currently not working (hence the draft status), but the headless and x11 mode are working and ready for review. Interestingly, the x11 mode works on wayland through compatibility.

@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Nov 4, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.83%. Comparing base (e67214e) to head (b8d7488).
Report is 36 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #9554      +/-   ##
============================================
- Coverage     42.49%   37.83%   -4.66%     
============================================
  Files          1312      990     -322     
  Lines        105608    90920   -14688     
  Branches       3305     1176    -2129     
============================================
- Hits          44878    34400   -10478     
+ Misses        58777    56066    -2711     
+ Partials       1953      454    -1499     
Flag Coverage Δ
core ?
editoast 73.23% <ø> (-0.49%) ⬇️
front 20.11% <ø> (+1.32%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Synar Synar requested review from emersion and Khoyo November 5, 2024 08:40
@emersion
Copy link
Member

emersion commented Nov 5, 2024

Have you seen this? https://playwright.dev/docs/test-ui-mode#docker--github-codespaces

@Synar Synar requested a review from Yohh November 5, 2024 09:34
@Synar
Copy link
Contributor Author

Synar commented Nov 5, 2024

Have you seen this? https://playwright.dev/docs/test-ui-mode#docker--github-codespaces

I had not, this should be much simpler

@Yohh
Copy link
Contributor

Yohh commented Nov 5, 2024

could we put run-front-playwright-container.sh in front/scripts?

@Khoyo
Copy link
Contributor

Khoyo commented Nov 5, 2024

could we put run-front-playwright-container.sh in front/scripts?

I mildly disagree, running the e2e tests shouldn't be a front thing.

@Synar
Copy link
Contributor Author

Synar commented Nov 5, 2024

Have you seen this? https://playwright.dev/docs/test-ui-mode#docker--github-codespaces

Tested, seems to work perfectly and should greatly simplify the script. Thanks a lot!

@Synar Synar force-pushed the ali/add-playwright-container-for-e2e-tests branch from 4441531 to 2e97c9f Compare November 5, 2024 21:48
@Synar
Copy link
Contributor Author

Synar commented Nov 5, 2024

Only problem remaining is that @ElysaSrc and @multun old hack to make sure created files are owned by the user and not root does not seem to be working here yet. Can you take a look @ElysaSrc ?

@Synar Synar requested a review from ElysaSrc November 5, 2024 22:16
@Synar Synar marked this pull request as ready for review November 6, 2024 15:47
@Synar Synar requested review from a team as code owners November 6, 2024 15:47
@Synar Synar requested review from emersion and Khoyo November 6, 2024 15:47
Khoyo

This comment was marked as outdated.

Copy link
Contributor

@Yohh Yohh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once rebased, this PR totally fixes the known issues about e2e tests while using host-compose.sh, thank you

@Yohh Yohh mentioned this pull request Nov 7, 2024
@Synar Synar force-pushed the ali/add-playwright-container-for-e2e-tests branch 4 times, most recently from 76bb43e to fc83bde Compare November 7, 2024 16:49
@Synar
Copy link
Contributor Author

Synar commented Nov 7, 2024

A bit outside the scope of this pr, but I noticed that the CI seems to spend a lot of time installing playwright deps with "npx playwright install --with-deps". Could we accelerate this using a microsoft/playwright based image, similar to what is done here?

@Khoyo
Copy link
Contributor

Khoyo commented Nov 8, 2024

A bit outside the scope of this pr, but I noticed that the CI seems to spend a lot of time installing playwright deps with "npx playwright install --with-deps". Could we accelerate this using a microsoft/playwright based image, similar to what is done here?

Potentially. A lot of the time is network transfer though, so it might not be much faster. Do you want to do it?

@Synar
Copy link
Contributor Author

Synar commented Nov 12, 2024

Sure. We can even reuse Dockerfile.playwright wholesale right? I'll do this in another PR though

@Synar Synar force-pushed the ali/add-playwright-container-for-e2e-tests branch from fc83bde to 33df660 Compare November 15, 2024 20:33
@Synar Synar force-pushed the ali/add-playwright-container-for-e2e-tests branch from 33df660 to b8d7488 Compare November 15, 2024 20:40
@Synar Synar added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 15, 2024
@Synar Synar added this pull request to the merge queue Nov 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 15, 2024
@Synar Synar added this pull request to the merge queue Nov 15, 2024
Merged via the queue into dev with commit 8a2b4c9 Nov 15, 2024
27 checks passed
@Synar Synar deleted the ali/add-playwright-container-for-e2e-tests branch November 15, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

front: add procedure to run e2e tests in docker to the readme
7 participants