Repository navigation
Deleted tests still check the files that list them, and Playwright fixture specs run under Playwright - #4702
Merged
capy-ai[bot] merged 6 commits intoNov 22, 2026
Conversation
…pecs A removed test that another test already covers now still runs the tests of the files that name it, so a stale curation list fails before merge (#3536). A spec that takes test from a local Playwright fixtures module now runs under playwright test instead of the unit runner (#4347). Rebuilt from #4158 and the detection half of #4347. Co-authored-by: Yuan S. <[email protected]> Co-authored-by: marcode <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: review-p1/specialist-batched#1 reader=specialist-batched Review-Finding: review-p1/specialist-batched#2 reader=specialist-batched Review-Finding: review-p1/red-team#1 reader=red-team Review-Finding: review-v1/outside-voice#1 reader=outside-voice Review-Finding: review-v1/outside-voice#2 reader=outside-voice Review-Finding: review-v1/outside-voice#3 reader=outside-voice Review-Finding: review-v1/outside-voice#4 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: review-p2/specialist-batched#1 reader=specialist-batched Review-Finding: review-p2/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 22, 2026
Merged
3 tasks done
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.
Deleting or renaming a test now runs the tests of files that still list it even when another test already covers it, and Playwright specs that take
testfrom a local fixtures file run underplaywright test.Why: a deleted test could pass the local checks while a stale curation list failed after merge (#3536), and fixture-based Playwright specs went to the unit runner and failed (#4347).
Nothing to do. A repo whose specs import
@playwright/testdirectly sees no change.What changed
lib/pregate/lane-selection.ts: the "files naming it" check for a removed test (deleted, or a rename's old name) now also runs when the removed test already maps to a test through adependenciesentry or a remaining test that names its path. Those files' tests run, and a naming file with no test fails closed. A mention does not count when it sits under another directory's path (packages/b/util.test.jsfor a deletedtest/util.test.js), and.gstack/pregate.jsondoes not count when its only mentions aredependencieskeys, listed tests beside another test that still exists, or another directory's test. A mention spelling the test's own directory always counts.lib/pregate/checks/lanes.ts: a JS/TS spec counts as a Playwright spec when it takestestfrom a repo module built on@playwright/test(base.extend(…),mergeTests(…)), directly, aliased, through named orexport *re-exports,indexmodules or a.jsspecifier naming a.tssource, up to 8 modules deep. A module that takestestfrom vitest,@jest/globals,bun:testornode:testkeeps the unit runner even when it also uses Playwright APIs, and nothing outside the repo is read.docs/pregate.mddescribes both rules. Tests: pregate: a removed test that maps to a test skips the files-naming-it check (pre-existing on main) #3536 cases, fail-closed and control rows intest/pregate-removed-paths.test.ts, and Run Playwright specs that use a local fixtures file under playwright test, and let a repo send chosen tests to its own runner #4347 plan rows (fixtures,export *,mergeTests, vitest-fixture and outside-the-repo controls) intest/pregate-selection.test.ts.Rebuilt on current main from #4158 by @szsunyuan and the detection half of #4347 by @vilano93, both credited as co-authors. The
runnerssetting proposed in #4347 is new configuration and is not included. Closes #3536.Known limits
dependencieslist holds the deleted test next to an existing non-test file,.gstack/pregate.jsonis not treated as still naming the deleted test, so the deletion is not refused. A later edit to that source fails only if nothing else covers it. A one-line fix follows separately.testfrom another local vitest module, or a barrel that re-exports vitest'stestnext toexport *of a Playwright helper, can be planned underplaywright test, which then fails loudly with no tests found.export { appTest as test }is not followed, so that spec keeps the unit runner, as before this change.packages/b/test/xcounts as a mention oftest/x(fails closed), and an unnormalizeda/src/../test/xmention is missed. A one-line fix follows separately.Security read
The test-selection change reads the repo's own
.gstack/pregate.jsonwith a JSON parse in a try/catch and reuses the existinggit grep; no new process starts. The Playwright detection reads repo files throughreadRepoFile, which refuses symlinks that leave the repo, follows only relative specifiers that stay inside it, and stops after 8 levels. No network, auth, CI, install script or dependency change. The outside diffs were read as text only; no outside branch was fetched or run.Issues
Refs #3536
Refs #4158
Refs #4347
Agent notes
Lane GSTA-805 for GStack Minder (GSTA-36), issue GST-3487, PR C of three. Repro on c2b4f0d: a deleted
test/util.test.jsmapped bydependenciestotest/retry.test.jswhilescripts/curation.jsstill listed it exited 0 running only retry.test.js; a spec importingtestfrom./fixtureplanned asnpx vitest run.lib/pregate/checks/lanes.tsis at 800 lines, the module-size limit.Documentation audit
Status: current. The branch's own docs changes are accurate; no edits needed.
Scope: 6 committed files from base 7530280 to head fb4fc55 (pregate lane selection and Playwright runner detection, their tests, one changelog.d fragment, docs/pregate.md). Nothing staged, unstaged or untracked. Searched docs/TESTING_INTERNALS.md, CONTRIBUTING.md, README.md, AGENTS.md and docs/ship-policy.md for related claims.
Documentation health:
Coverage debt: none. No new command, flag or setting; both changes are behavior fixes covered in the docs/pregate.md reference. No diagram drift.
Plan: exempt: bug fixes with a repro on current main
Review: 2 full rounds (ship-4702: 9 fixes) and one read-only final review of 36a9e80 (ship-4702b, R51) granted by GStack Minder; its four second-model blockers were ruled disclosed notes by GSTA-36. The owner-ref timestamp on the rulings reads 14:15Z; the relayed message arrived at about 13:40Z.
Ruled note: lib/pregate/lane-selection.ts:171:correctness at 36a9e80 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T14:15Z) at 2026-11-22T13:41:11.005Z: a non-test sibling exempts a stale only-test dependencies entry; narrow fail-open, isTestFile fix deferred to a follow-up (approval a-c57d8232ada7)
Ruled note: lib/pregate/checks/lanes.ts:219:correctness at 36a9e80 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T14:15Z) at 2026-11-22T13:41:11.198Z: a vitest fixture or barrel that also imports Playwright can route to playwright test: a loud false red in a rare layout (approval a-2babea53cc78)
Ruled note: lib/pregate/checks/lanes.ts:203:correctness at 36a9e80 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T14:15Z) at 2026-11-22T13:41:11.385Z: export { appTest as test } is not followed, so that spec keeps the unit runner exactly as on main (approval a-76d0f2346816)
Ruled note: lib/pregate/lane-selection.ts:177:correctness at 36a9e80 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T14:15Z) at 2026-11-22T13:41:11.578Z: directory suffixes are not path identity: fail closed, fail-open only for unnormalized .. mentions; fix deferred to a follow-up (approval a-f501e9d3fd5a)