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

Shard playwright tests into two separate jobs using a matrix #47629

Merged
merged 5 commits into from
Feb 2, 2023

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Feb 1, 2023

What/Why?

I noticed that Playwright tests are taking around 30 minutes on CI, while each of the Puppeteer tests are taking around 15 minutes. It'd be good to keep them consistent.

This PR tries sharding the playwright tests in a similar way to how we divide up puppeteer jobs. Playwright supports this, so it should be a bit easier.

Hopefully the command I've added will work.

How?

Use a matrix in the github action, to divide tests across two separate machines.

@talldan talldan added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Feb 1, 2023
@talldan talldan self-assigned this Feb 1, 2023
@talldan
Copy link
Contributor Author

talldan commented Feb 1, 2023

It doesn't seem to have worked.

Playwright 1:

Running 0 tests using 0 workers, shard 1 of 2

=================
 no tests found.
=================

Playwright 2:

Running 0 tests using 0 workers, shard 2 of 2

=================
 no tests found.
=================

edit: kudos to @kevin940726 for spotting a stray }}, which must have been interpreted as the test filename part of the command.

@talldan
Copy link
Contributor Author

talldan commented Feb 1, 2023

That seems to be working now.

Playwright tests took 19 minutes in that last test run, and puppeteer tests 17 minutes.

We can consider removing a puppeteer machine and adding another playwright one as more tests are migrated.

@github-actions
Copy link

github-actions bot commented Feb 1, 2023

Flaky tests detected in 331f068.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4062162471
📝 Reported issues:

Copy link
Member

@kevin940726 kevin940726 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Not sure how many total parts we should use here, but we can always change that in the future.

@kevin940726
Copy link
Member

Looks like we need to change the settings again to mark Playwright - 1 and Playwright - 2 as required. 😅

@talldan
Copy link
Contributor Author

talldan commented Feb 1, 2023

Looks like we need to change the settings again to mark Playwright - 1 and Playwright - 2 as required. 😅

Ah gosh. Lets do it tomorrow, probably not a great thing to do on the plugin release day, especially the last one before 6.2 😄

@talldan talldan merged commit f66aa3a into trunk Feb 2, 2023
@talldan talldan deleted the try/sharding-playwright-tests-on-ci branch February 2, 2023 02:38
@talldan talldan changed the title Try sharding playwright tests into two separate jobs using a matrix Shard playwright tests into two separate jobs using a matrix Feb 2, 2023
@github-actions github-actions bot added this to the Gutenberg 15.2 milestone Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants