Playwright’s sharding docs present the following GitHub actions configuration:
strategy: fail-fast: false matrix: shardIndex: [1, 2, 3, 4] shardTotal: [4] [...] steps: - name: Run Playwright tests run: | npx playwright test \ --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
While it works, I think the following reads much better:
strategy: fail-fast: false matrix: shard: ["1/4", "2/4", "3/4", "4/4"] [...] steps: - name: Run Playwright tests run: npx playwright test --shard=${{ matrix.shard }}
You don't even need the quotes around "1/4"
, you could write them naked, but I prefer to be explicit in yaml:
shard: [1/4, 2/4, 3/4, 4/4]
What do you think?
Top comments (0)