Skip to content

Commit

Permalink
[e2e tests blocks] Configure the number of shards for each matrix pro…
Browse files Browse the repository at this point in the history
…ject (#45212)

* Reduce the shards from 5 to 2 for blocks e2e tests

* Include the workflow in paths

* More granular shard config

* Refine shards config
  • Loading branch information
adimoldovan committed Feb 29, 2024
1 parent 5401d14 commit 7278965
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/blocks-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
- '.github/workflows/blocks-playwright.yml'

env:
FORCE_COLOR: 1
Expand All @@ -25,21 +26,35 @@ jobs:
- name: Normal
file: playwright.config.ts
resultPath: test-results
shard: 1/3
- name: Normal
file: playwright.config.ts
resultPath: test-results
shard: 2/3
- name: Normal
file: playwright.config.ts
resultPath: test-results
shard: 3/3
- name: Classic
file: playwright.classic-theme.config.ts
resultPath: test-results-classic-theme
shard: 1/1
- name: SideEffects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
shard: 1/3
- name: SideEffects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
shard: 2/3
- name: SideEffects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
shard: 3/3
- name: BlockThemeWithTemplates
file: playwright.block-theme-with-templates.config.ts
resultPath: test-results-block-theme-with-templates
shards:
- name: 1/5
- name: 2/5
- name: 3/5
- name: 4/5
- name: 5/5
shard: 1/1
steps:
- uses: actions/checkout@v3

Expand All @@ -57,7 +72,7 @@ jobs:

- name: Run Playwright tests
working-directory: plugins/woocommerce-blocks
run: pnpm playwright test --config=tests/e2e/${{ matrix.config.file }} --shard ${{ matrix.shards.name }}
run: pnpm playwright test --config=tests/e2e/${{ matrix.config.file }} --shard ${{ matrix.config.shard }}

- uses: actions/upload-artifact@v3
if: ${{ failure() }}
Expand Down

0 comments on commit 7278965

Please sign in to comment.