Skip to content

Fail a web e2e shard that does not run the tests planned for it - #604

Merged
yansfil merged 2 commits into
mainfrom
ci/web-e2e-shard-checks
Oct 6, 2026
Merged

yansfil merged 2 commits into
mainfrom
ci/web-e2e-shard-checks

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Part of with-hide/hide-private#100

Summary

#597 deals the web e2e shards by recorded durations; its review found that a shard could run fewer tests than planned, or none, and stay green. This makes the step prove what it runs.

  • The shard file is written as UTF-8 bytes. Through a Windows runner's cp1252 stdout › was one byte Playwright read as no delimiter, so no test matched, and Playwright counts a --test-list that matches nothing as a pass.
  • web-e2e-shard.py check runs after the split: it fails the step unless playwright test --list --test-list <shard file> lists exactly the tests split planned, with one line saying how many matched nothing.
  • A problem with the list, the table or the plan is one line and exit status 1, never a traceback.
  • A grep that leaves fewer tests than shards leaves the extra shards an empty file and an early end, as the old --shard did, instead of a failure.
  • durations --list keeps only listed tests, takes a passing retry as its test, and reads a Windows runner's ok mark, so a refresh needs no hand pruning.
  • The balance claim became a report: the plan warns (first shard only) when listed tests are missing from the table or the heaviest shard is over 15 % above the mean, and docs/TESTING.md and CONTRIBUTING.md say what is dealt and what is not measured.

Review

  • 판단해 주세요: the duration table stays a Linux recording; only the pull request's Linux lane deals by it now that the nightly runs one shard per system (Run only the OS-difference desktop tests on Linux and Windows nightly #566), so the macOS and Windows balance claim is removed, not measured.
  • 조심해서 볼 파일: .github/workflows/web-e2e.yml - the step lists twice per shard (full, then --test-list) and check compares them; a mismatch fails the step.
  • 조심해서 볼 파일: scripts/web-e2e-shard.py - emit writes bytes to stdout.buffer, read decodes UTF-8 explicitly.
  • 질문: review item 6 (list once in the build job and hand shard files to the shards) is not done: it saves about 2 seconds of cold TypeScript load per shard and moves the list into an artifact, which this change does not need.

Evidence

  • 확인한 것: python3 -m unittest discover -s scripts/tests passes (160 tests); new ones run the script with PYTHONIOENCODING=cp1252 and assert the shard file is exactly the UTF-8 bytes, check passes and fails (nothing matched, unplanned tests selected, empty shard), inputs fail as one line without Traceback, and the table names only file › title keys of existing specs.
  • 확인한 것: against the real suite, split, playwright --list --test-list and check pass for all four shards (44, 47, 43 and 45 tests, 179 in all); a shard file naming a test that does not exist fails check with "would run 0 tests, not the 44 planned".
  • 확인한 것: a one-test grep over four shards gives shard 1 the test and shards 2 to 4 an empty file.
  • 확인한 것: the committed table is unchanged by the new parser: regenerated from the same 118 logs with durations --list it is identical (179 tests).
  • 확인하지 못한 것: a Windows runner. The encoding is covered by a cp1252 run on macOS and the ok mark by a log line; the real Windows nightly runs one shard per lane, so this path does not run there today.

@yansfil
yansfil merged commit 5884d5c into main Oct 6, 2026
19 checks passed
@yansfil
yansfil deleted the ci/web-e2e-shard-checks branch October 6, 2026 03:52
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.

1 participant