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

Blocks E2E: Refactor configs and workflow #46409

Merged
merged 45 commits into from May 13, 2024

Conversation

WunderBart
Copy link
Contributor

@WunderBart WunderBart commented Apr 10, 2024

Follow-up to #46125
Closes: #46331
Related: pdV5qK-nT-p2#possible-solutions

Proposed Changes

This PR enhances the efficiency of running our Blocks E2E tests both locally and in our CI environment.

First, we have eliminated all side effects references as a continuation of #46125, ensuring they are permanently resolved. 🎉

Regarding CI improvements, we've restructured the Playwright configuration (#46331) to enable all tests to run in a single job rather than a 3D theme-based matrix. This adjustment reduces resource usage by half (10 instead of 20 shards) and accelerates test completion due to better-balanced shards (cc: @tammullen). Additionally, we introduced a Merge Artifacts step, consolidating all debug artifacts from separate shards into one zip file for convenience.

For local testing improvements, we've reduced global setup rerun times by reusing existing database snapshots created within the initial run (introduced in #46125). We've also simplified the test execution process, making it unnecessary to identify the specific project (block-theme, classic-theme, or block-theme-with-templates) the test belongs to. Running a single suite is now as straightforward as using pnpm test:e2e path-to/any-suite.spec.ts. However, executing all theme-based groups remains an option through pnpm test:e2e:block-theme/class-theme/block-theme-with-templates when required.

Testing Instructions

Ensure running tests via pnpm test:e2e, pnpm test:e2e:block-theme, pnpm test:e2e:classic-theme, pnpm test:e2e:block-theme-with-templates works as expected. Ensure all CI tests pass.

⚠️ Some tests might still be flaky. However, that flakiness is out of the scope of this PR, as it is no longer caused by the side effects. Those flaky tests need to be investigated individually.

Next Steps

  • Update E2E docs.
  • Explore uploading DB snapshot to the repo to reduce setup time.

@github-actions github-actions bot added the focus: monorepo infrastructure Issues and PRs related to monorepo tooling. label Apr 10, 2024
@WunderBart WunderBart changed the base branch from trunk to try/e2e-db-reset April 10, 2024 09:37
@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch 3 times, most recently from 121e993 to 3b9f185 Compare April 10, 2024 15:44
@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch from f339aee to 116d53a Compare April 11, 2024 08:22
@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch from 116d53a to 9027f4f Compare April 16, 2024 16:33
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Apr 16, 2024
@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch 7 times, most recently from e79731f to 5a2860f Compare April 19, 2024 15:00
@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch from 5a2860f to aa1a236 Compare April 24, 2024 11:11
Base automatically changed from try/e2e-db-reset to trunk April 26, 2024 09:39
@gigitux
Copy link
Contributor

gigitux commented Apr 30, 2024

looking even further, do we even need the block/classic theme distinction? Do you think it's a useful thing to have?

Yeah, good point. I think that the classic/block suffixes are useful to have some separation. Otherwise, there is the risk that we will put everything in one file, and E2E tests will be huge.

@WunderBart
Copy link
Contributor Author

WunderBart commented Apr 30, 2024

looking even further, do we even need the block/classic theme distinction? Do you think it's a useful thing to have?

Yeah, good point. I think that the classic/block suffixes are useful for some separation. Otherwise, there is the risk that we will put everything in one file, and the E2E tests will be huge.

I also lean towards keeping them in separate files – it keeps the structure flat. I'll merge the block-theme-with-templates with block-theme, then!

edit:

OTOH, there are only 11 tests for the classic theme, so I propose discussing the theme-based separation in another PR, if that's OK! 😅

@gigitux
Copy link
Contributor

gigitux commented Apr 30, 2024

OTOH, there are only 11 tests for the classic theme, so I propose discussing the theme-based separation in another PR, if that's OK! 😅

As I mentioned via DMs, my comment isn't a blocker 👍 On my side, this PR can be merged! :shipit:

@nielslange
Copy link
Member

@WunderBart Firstly, thank you so much for working on this! This is another great improvement to the e2e tests. Regarding using different themes, what you and @gigitux discussed above, I recently created #46746. Not directly related to the issue raised by @gigitux, but a potential speed improvement when setting up the test env.

@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch from 8e42aa6 to db0e8e1 Compare May 2, 2024 11:38
@WunderBart WunderBart force-pushed the refactor/e2e-playwright-configs branch from db0e8e1 to 0492dae Compare May 2, 2024 13:01
Looks like there was an update to the editor and the blocks commercial is no longer visible
After a flawless run (0 failured & flaky tests) no artifacts will be produced, so don't fail the merge artifacts step.
Copy link
Contributor

github-actions bot commented May 9, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

@WunderBart WunderBart merged commit 30756f7 into trunk May 13, 2024
37 checks passed
@WunderBart WunderBart deleted the refactor/e2e-playwright-configs branch May 13, 2024 12:58
@WunderBart WunderBart restored the refactor/e2e-playwright-configs branch May 13, 2024 12:58
@github-actions github-actions bot added this to the 9.0.0 milestone May 13, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label May 13, 2024
@WunderBart WunderBart deleted the refactor/e2e-playwright-configs branch May 13, 2024 13:06
@rodelgc rodelgc added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: monorepo infrastructure Issues and PRs related to monorepo tooling. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocks E2E: Optimize sharding / CI resource usage
5 participants