Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .dagger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,23 @@ const E2E_TIMING_SUMMARY = [
" console.log('E2E-TIMING shard=' + process.argv[1] + ' ' + String(Math.round(ms / 1000)).padStart(5) + 's ' + String(count).padStart(3) + ' tests ' + file);",
].join(' ');

/**
* Shard sizes, in tests, for `PWTEST_SHARD_WEIGHTS`, keyed by shard count.
*
* Playwright cuts the test list into contiguous slices of equal test count, but
* the tests differ in cost: with equal counts, run 4783 (one worker per shard)
* took 30.3, ~22.9, 27.1 and 26.5 min, and a shard's minutes are its
* `E2E-TIMING test-seconds`. These sizes come from the per-file timings of all
* four shards on run 4790: costed per test in suite order, they put every
* shard within 2252 to 2279 s of that run. Weights are proportions, so a
* growing suite keeps the same split. Re-measure from the `E2E-TIMING` lines
* when it drifts. Playwright wants the weights separated by ":" and one per
* shard, so only a shard count with an entry here is weighted.
*/
const E2E_SHARD_WEIGHTS: Record<number, string> = {
4: '62:90:84:79',
};

/**
* `bash -c` payload for one Playwright shard.
*
Expand All @@ -214,6 +231,9 @@ function e2eShardRunScript(
return (
'set -o pipefail; ' +
`echo "e2e mode grep=${grepLabel} shard=${shardIndex}/${shardCount} workers=$PLAYWRIGHT_WORKERS retries=$PLAYWRIGHT_RETRIES"; ` +
(E2E_SHARD_WEIGHTS[shardCount]
? `export PWTEST_SHARD_WEIGHTS=${E2E_SHARD_WEIGHTS[shardCount]}; `
: '') +
'export PLAYWRIGHT_JSON_OUTPUT_NAME=/test-results.json; ' +
`pnpm exec playwright test --config=./playwright.config.ts${grepFlag} --shard=${shardIndex}/${shardCount} 2>&1 | tee /test-output.log; ` +
'echo ${PIPESTATUS[0]} > /test-exit-code; ' +
Expand Down
Loading