Skip to content

[QA] Add parallel E2E test execution in CI#4305

Open
syde-piotr-ostrowski wants to merge 3 commits intodev/developfrom
dev/qa/ci-parallel-test-executions
Open

[QA] Add parallel E2E test execution in CI#4305
syde-piotr-ostrowski wants to merge 3 commits intodev/developfrom
dev/qa/ci-parallel-test-executions

Conversation

@syde-piotr-ostrowski
Copy link
Copy Markdown
Collaborator

@syde-piotr-ostrowski syde-piotr-ostrowski commented Apr 27, 2026

Adds a separate CI option for running the full Playwright E2E suite in parallel across multiple wp-env setups.

The new e2e:test:all:parallel workflow input splits execution into dedicated shards for:

  1. plugin foundation
  2. onboarding/settings
  3. transactions
  4. refunds
  5. vaulting
  6. subscriptions

Each shard runs in its own CI job, allowing tests to execute independently instead of blocking each other.

For now this is added as a separate manual workflow option, so the existing default E2E runs remain unchanged. In the future, this parallel execution can be promoted to the default release test run.

How to run

  • Trigger the E2E Tests workflow manually.
  • Select e2e:test:all:parallel.
  • Verify that all shard jobs start independently and report results/artifacts correctly

Test run

Here you can view the how the workflow was executed

Comment thread .github/workflows/e2e-tests.yml Outdated

e2e-playwright-parallel:
name: Run Playwright E2E Tests / ${{ matrix.shard }}
if: ${{ inputs.TEST_SUITE == 'e2e:test:all:parallel' }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

e2e-playwright and e2e-playwright-parallel are almost duplicate. It should be possible to resolve matrix in a separate job and avoid duplication of other code?

// Parallel CI
{
name: 'shard:plugin-foundation',
dependencies: [ 'setup-woocommerce' ],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

plugin-foundation was the only set of tests which required not installed PCP plugin.

Since plugin-foundation is already the separate project, I was about to extract the common preconditions from other test specs. But since your PR is quite close to it I'd suggest to do it here.

All of the projects depend on setup-woocommerce but almost all except plugin-foundation might also depend on setup-pcp-usa-for-tests (or similar, like setup-pcp-vaulting, setup-pcp-subscription). This would allow to shorten beforeAll hooks which in case if test fails are being reexecuted and cause significant time loss. So I was thinking about something like:

{
	name: 'setup-pcp-usa-for-tests',
	dependencies: [ 'setup-woocommerce' ],
	testMatch: /pcp\.setup\.ts/,
    grep: 'setup:pcp:usa;',
},
{
	name: 'shard:transactions',
	dependencies: [ 'setup-pcp-usa-for-tests' ],
	testMatch: /05-transactions\/.*\.spec\.ts/,
},

Note: There's setup-pcp project already but it has many setups and also serves for env:setup npm scripts.

@syde-piotr-ostrowski
Copy link
Copy Markdown
Collaborator Author

@mishautkin
Thanks, I did following changes according to your suggestions:

  • The E2E workflow now uses one Playwright job for both normal and parallel runs.
  • The parallel shard list is resolved in a separate job.
  • Added separate Playwright setup projects for transactions, refunds, vaulting, and subscriptions.
  • Removed repeated PCP install/reset/connect setup from the affected tests.

Checked test execution locally. Now running in GitHub here

Copy link
Copy Markdown
Collaborator

@mishautkin mishautkin left a comment

Choose a reason for hiding this comment

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

Hi, @syde-piotr-ostrowski, thank you for the updates. Have couple of general comments:

  1. I see there are a lot of failed tests in CI runs (e.g. I cansee that ACDC gateway is not visible)
  2. All of the shards have the same name - run-playwright-tests. Is it possible to change the name per shard?
    Update: run-playwright-tests is a job name in reusable test-playwright.yml. Let's skip it in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants