Repository navigation
Description
Context
Two PRs in a row passed bun run check:pr --base origin/main locally, then failed hosted unit (1) on the same check: #3955 (the persona-settings-runtime test) and #3956 (the live-service-runtime test). Each added a packages/ui-react/tests/*-runtime.test.ts that calls runtimePackageBuild( but did not list it in runtimeTestBuilds in scripts/runtime-test-builds.ts.
The guard that caught it is the first test in tests/runtime-build-selection.test.ts. It counts the runtime-package hooks (expect(hooks).toHaveLength(22)) and requires them to equal Object.keys(runtimeBuildInventory) (runtimeBuildInventory, scripts/runtime-test-builds.ts:13).
The preflight's "affected fast invariants" check (scripts/check-pr.ts:30 and scripts/check-pr.ts:45) runs plan.tests, and for both PRs that list did not include tests/runtime-build-selection.test.ts. The guard reads every file in packages/ui-react/tests/, so a newly added hook is one of its inputs even though the test imports none of it. Each miss cost one hosted proof run and a lease cycle.
Out of scope
- Changing what
runtime-build-selection.test.tsasserts. - Generating the inventory automatically.
- Other directory-scanning guards, apart from listing them (see Scope).
Scope
- Make the affected-test planner select
tests/runtime-build-selection.test.tswhenever a change adds, removes or renames a file underpackages/ui-react/tests/that containsruntimePackageBuild(, or touchesscripts/runtime-test-builds.ts. - If other fast tests have the same blind spot, because they scan a directory instead of importing it, list them in the PR. File a follow-up for them, or cover them the same way.
Acceptance criteria
-
bun run check:pr --base origin/main --planliststests/runtime-build-selection.test.tsfor a branch that only adds a newpackages/ui-react/tests/x-runtime.test.tscallingruntimePackageBuild(. - A planner unit test asserts that selection, and fails before the change.
- A branch that touches neither those files nor
scripts/runtime-test-builds.tsdoes not newly select the test.
Verification
- A planner unit test with a failing-first receipt.
- One
--planrun on a scratch branch.
Contract impact
None.
Activity