Repository navigation
Fail a web e2e shard that does not run the tests planned for it - #604
Merged
Merged
Conversation
…write the shard file as UTF-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
›was one byte Playwright read as no delimiter, so no test matched, and Playwright counts a--test-listthat matches nothing as a pass.web-e2e-shard.py checkruns after the split: it fails the step unlessplaywright test --list --test-list <shard file>lists exactly the testssplitplanned, with one line saying how many matched nothing.grepthat leaves fewer tests than shards leaves the extra shards an empty file and an early end, as the old--sharddid, instead of a failure.durations --listkeeps only listed tests, takes a passing retry as its test, and reads a Windows runner'sokmark, so a refresh needs no hand pruning.Review
.github/workflows/web-e2e.yml- the step lists twice per shard (full, then--test-list) andcheckcompares them; a mismatch fails the step.scripts/web-e2e-shard.py-emitwrites bytes tostdout.buffer,readdecodes UTF-8 explicitly.buildjob 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/testspasses (160 tests); new ones run the script withPYTHONIOENCODING=cp1252and assert the shard file is exactly the UTF-8 bytes,checkpasses and fails (nothing matched, unplanned tests selected, empty shard), inputs fail as one line withoutTraceback, and the table names onlyfile › titlekeys of existing specs.split,playwright --list --test-listandcheckpass for all four shards (44, 47, 43 and 45 tests, 179 in all); a shard file naming a test that does not exist failscheckwith "would run 0 tests, not the 44 planned".grepover four shards gives shard 1 the test and shards 2 to 4 an empty file.durations --listit is identical (179 tests).okmark by a log line; the real Windows nightly runs one shard per lane, so this path does not run there today.