[e2e tests blocks] Configure the number of shards for each matrix project (#45212)

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

* Include the workflow in paths

* More granular shard config

* Refine shards config
This commit is contained in:
Adrian Moldovan 2024-02-29 21:50:17 +02:00 committed by GitHub
parent 5401d143a4
commit 72789656cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 22 additions and 7 deletions

View File

@ -6,6 +6,7 @@ on:
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
- '.github/workflows/blocks-playwright.yml'
env:
FORCE_COLOR: 1
@ -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
@ -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() }}