Skip to content

Commit 8fee978

Browse files
committed
Add test location audit and Windows-safe lane runner preflight to prevent misplaced tests and wasted Playwright reruns - PR_26146_025-test-location-audit-and-runner-preflight
1 parent cd6c688 commit 8fee978

13 files changed

Lines changed: 26334 additions & 41 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Test Location Audit Report
2+
3+
Generated: 2026-05-26T17:59:33.363Z
4+
Status: PASS
5+
6+
## Scope
7+
8+
- Tool Playwright specs: tests/playwright/tools
9+
- Game Playwright specs: tests/playwright/games
10+
- Shared helpers: tests/helpers
11+
12+
## Blocking Findings
13+
14+
No blocking test location findings.
15+
16+
## Relocated Game-Owned Specs
17+
18+
| Previous Path | Current Path | Status | Reason |
19+
| --- | --- | --- | --- |
20+
| tests/playwright/tools/AsteroidsBackgroundAssetResolution.spec.mjs | tests/playwright/games/AsteroidsBackgroundAssetResolution.spec.mjs | PASS | Game-owned Asteroids Playwright spec is under tests/playwright/games. |
21+
| tests/playwright/tools/AsteroidsBeatTiming.spec.mjs | tests/playwright/games/AsteroidsBeatTiming.spec.mjs | PASS | Game-owned Asteroids Playwright spec is under tests/playwright/games. |
22+
| tests/playwright/tools/AsteroidsGameSceneCleanup.spec.mjs | tests/playwright/games/AsteroidsGameSceneCleanup.spec.mjs | PASS | Game-owned Asteroids Playwright spec is under tests/playwright/games. |
23+
| tests/playwright/tools/AsteroidsShipStateVisuals.spec.mjs | tests/playwright/games/AsteroidsShipStateVisuals.spec.mjs | PASS | Game-owned Asteroids Playwright spec is under tests/playwright/games. |
24+
25+
## Documented Tool Tests With Game Fixtures
26+
27+
| File | Referenced Game Fixture(s) | Reason |
28+
| --- | --- | --- |
29+
| tests/playwright/tools/AssetManagerV2.spec.mjs | Asteroids, GravityWell, Pong | Tool runtime validation uses repo/game manifests as explicit asset payload fixtures. |
30+
| tests/playwright/tools/CollisionInspectorV2.spec.mjs | Asteroids | Tool runtime validation uses game manifests as explicit collision payload fixtures. |
31+
| tests/playwright/tools/WorkspaceManagerV2.spec.mjs | AITargetDummy, Asteroids, Bouncing-ball, Breakout, GravityWell, Pacman, Pong, SolarSystem, SpaceDuel, SpaceInvaders, vector-arcade-sample | Workspace contract validation uses game manifests as explicit launch/toolState fixtures. |
32+
33+
## Intentionally Shared Helpers
34+
35+
| File | Reason |
36+
| --- | --- |
37+
| tests/helpers/playwrightRepoServer.mjs | Shared HTTP repo fixture used by tool, game, and integration Playwright suites. |
38+
| tests/helpers/playwrightStorageIsolation.mjs | Shared localStorage/sessionStorage cleanup helper used before targeted Playwright tests. |
39+
| tests/helpers/workspaceV2CoverageReporter.mjs | Shared V8 coverage collection for Workspace V2 and impacted browser runtime suites. |
40+
41+
## Ownership Rules Checked
42+
43+
- Game-specific Playwright tests must live under tests/playwright/games.
44+
- Tool Playwright tests may use game manifests only as explicit, documented fixtures for tool behavior.
45+
- Shared helper filenames must not include game-specific names.
46+
- Lane execution should stop before expensive Playwright runs when this audit reports blocking findings.
Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
11
# Testing Lane Execution Report
22

33
Generated: 2026-05-26
4-
PR: PR_26146_024-targeted-test-lanes-and-isolation-execution
4+
PR: PR_26146_025-test-location-audit-and-runner-preflight
55

66
## Summary
77

88
PASS: 3
99
WARN: 1
1010
FAIL: 0
11-
SKIP: 1
11+
SKIP: 3
1212

1313
## Full Samples Smoke
1414

1515
Status: SKIP
16-
Reason: Changed files only add targeted lane execution and Playwright/test isolation infrastructure. No sample JSON, shared sample loader, or sample framework files were changed.
16+
Reason: This PR changes Playwright test placement, audit/preflight scripts, and targeted lane runner behavior only. No sample JSON, shared sample loader, or sample framework files were changed.
1717

18-
## Lane Results
18+
## Executed and Skipped Lanes
1919

20-
| Lane | Status | Executed/Skipped Reason | Affected Surface | Evidence |
20+
| Lane / Check | Status | Executed/Skipped Reason | Affected Surface | Evidence |
2121
| --- | --- | --- | --- | --- |
22-
| workspace-contract | WARN | Executed because Workspace V2 test wiring was impacted by Playwright storage isolation. | Workspace Manager V2 contract/lifecycle behavior | `PLAYWRIGHT_BROWSERS_PATH=0 npm run test:lane:workspace-contract` invoked existing `npm run test:workspace-v2`; 64 passed, 8 out-of-scope Workspace/Input Mapping/manifest/Preview Generator expectations failed. |
23-
| tool-runtime | PASS | Executed because tool-runtime lane wiring and storage isolation were added for focused tool suites. | Asset Manager V2, Preview Generator V2, Collision Inspector V2 runtime behavior | `PLAYWRIGHT_BROWSERS_PATH=0 npm run test:lane:tool-runtime`; Asset Manager V2 focused launch/runtime subset 5 passed, Preview Generator V2 7 passed, Collision Inspector V2 4 passed. |
24-
| integration | PASS | Executed because integration lane wiring was added for explicit cross-surface handoff validation. | Game index preview manifest handoff | `PLAYWRIGHT_BROWSERS_PATH=0 npm run test:lane:integration`; focused Pong handoff subset 3 passed. |
25-
| engine-src | PASS | Executed because engine/src lane wiring and node storage isolation were added. | src/ engine and shared runtime capability behavior | `npm run test:lane:engine-src`; 11/11 targeted node test files passed. |
26-
| samples | SKIP | Skipped because samples are on-request or affected-sample only and this PR did not impact samples. | On-request samples lane | Not run. Full samples smoke also skipped. |
22+
| test-location-preflight | PASS | Executed first because this PR adds the audit/preflight gate. | Playwright file ownership and lane placement | `npm run test:lanes:preflight` passed and wrote `docs/dev/reports/test_location_audit_report.md`. |
23+
| tool-runtime | PASS | Executed because tool test routing changed and the runner preflight/Node CLI path needed validation. | Asset Manager V2, Preview Generator V2, Collision Inspector V2 runtime tests | `PLAYWRIGHT_BROWSERS_PATH=0 npm run test:lane:tool-runtime`; preflight passed, Asset Manager V2 focused subset 5 passed, Preview Generator V2 7 passed, Collision Inspector V2 4 passed. |
24+
| integration | PASS | Executed because the runner preflight also guards game/integration Playwright placement. | Game index preview manifest handoff | `PLAYWRIGHT_BROWSERS_PATH=0 npm run test:lane:integration`; preflight passed, focused Pong handoff subset 3 passed. |
25+
| moved-game-specs | WARN | Executed once to validate relocated Asteroids game specs without changing game runtime behavior. | Asteroids game-specific Playwright tests moved from tools to games | 5 passed, 1 existing Asteroids ship-state expectation failed; exact failing test listed below. |
26+
| workspace-contract | SKIP | Skipped because `npm run test:workspace-v2` behavior was preserved and Workspace V2 runner wiring was not changed for this PR. | Workspace Manager V2 contract/lifecycle behavior | Not run. |
27+
| engine-src | SKIP | Skipped because no `src/`, engine, or node runtime test lane files were changed. | src/ engine/shared runtime behavior | Not run. |
28+
| samples | SKIP | Skipped because samples are on-request or affected-sample only and this PR did not impact samples. | On-request samples lane | Not run. |
2729

28-
## Workspace V2 WARN Details
30+
## Moved Game Spec WARN Detail
2931

30-
`npm run test:workspace-v2` was run once through the workspace-contract lane and exited non-zero. The exact failing tests were:
32+
Focused command:
3133

32-
- `Workspace Manager V2 bootstrap > sizes Input Mapping V2 columns and live-highlights mapped non-keyboard inputs`
33-
- `Workspace Manager V2 bootstrap > resolves game manifest schema refs from the game schema during repo discovery`
34-
- `Workspace Manager V2 bootstrap > enables object vector and collision tools only from manifest geometry without fallback defaults`
35-
- `Workspace Manager V2 bootstrap > uses header lifecycle controls and launches tools from fixed Workspace Manager V2 tiles`
36-
- `Workspace Manager V2 bootstrap > keeps Preview Generator V2 repo writer after Asset Manager V2 deletes the preview asset entry`
37-
- `Workspace Manager V2 bootstrap > fails Preview Generator V2 without OK WRITE when live handle read-back verification fails`
38-
- `Workspace Manager V2 bootstrap > loads Gravity Well and Pong manifests as current Workspace Manager V2 manifests`
39-
- `Workspace Manager V2 bootstrap > owns temporary UAT manifest seeding and launches Asset Manager V2 through session context`
34+
`PLAYWRIGHT_BROWSERS_PATH=0 node ./node_modules/@playwright/test/cli.js test tests/playwright/games/AsteroidsBackgroundAssetResolution.spec.mjs tests/playwright/games/AsteroidsBeatTiming.spec.mjs tests/playwright/games/AsteroidsGameSceneCleanup.spec.mjs tests/playwright/games/AsteroidsShipStateVisuals.spec.mjs --project=playwright --workers=1 --reporter=list`
4035

41-
These were reported as lane WARN because they are broad Workspace/Input Mapping/manifest/Preview Generator assertions outside this testing-lane infrastructure PR. The full suite was not rerun.
36+
Result: 5 passed, 1 failed.
37+
38+
Failing test:
39+
40+
- `AsteroidsShipStateVisuals.spec.mjs > validates Asteroids ship visual states from manifest runtime rendering`
41+
42+
Observed failure: expected ship visual states to include `destroyed`, but the runtime returned `["idle", "move"]`. This was recorded as WARN because the PR only moves test ownership and runner preflight behavior; it does not alter Asteroids runtime or sample JSON.
4243

4344
## Static Validation
4445

46+
- PASS `node --check scripts/audit-playwright-test-locations.mjs`
4547
- PASS `node --check scripts/run-targeted-test-lanes.mjs`
46-
- PASS `node --check scripts/run-node-test-files.mjs`
47-
- PASS `node --check tests/helpers/playwrightStorageIsolation.mjs`
48-
- PASS `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs`
49-
- PASS `node --check tests/playwright/tools/AssetManagerV2.spec.mjs`
50-
- PASS `node --check tests/playwright/tools/PreviewGeneratorV2Baseline.spec.mjs`
51-
- PASS `node --check tests/playwright/tools/CollisionInspectorV2.spec.mjs`
52-
- PASS `node --check tests/playwright/games/GameIndexPreviewManifestResolution.spec.mjs`
53-
54-
## Lane Routing Notes
55-
56-
- Targeted execution is now available through `npm run test:lanes` and per-lane scripts.
57-
- `npm run test:workspace-v2` remains unchanged and callable directly.
58-
- The integration lane intentionally validates an explicit Pong handoff subset; broad all-game thumbnail coverage is not part of the default targeted lane.
59-
- The samples lane is available on request through `npm run test:lane:samples`, but the full samples smoke remains manual/on-request unless sample scope is active.
48+
- PASS `node --check tests/playwright/games/AsteroidsBackgroundAssetResolution.spec.mjs`
49+
- PASS `node --check tests/playwright/games/AsteroidsBeatTiming.spec.mjs`
50+
- PASS `node --check tests/playwright/games/AsteroidsGameSceneCleanup.spec.mjs`
51+
- PASS `node --check tests/playwright/games/AsteroidsShipStateVisuals.spec.mjs`
52+
53+
## Runner Safeguards
54+
55+
- Playwright lane commands run through `node node_modules/@playwright/test/cli.js`, so grep patterns such as `launch guard|temporary UAT context|rejects non-Workspace` remain literal on Windows.
56+
- Playwright-bearing lanes run the location audit before expensive execution.
57+
- If the audit reports blocking placement findings, the lane runner writes the lane report and exits before running long Playwright suites.
58+
- No full lanes were rerun after known out-of-scope failures.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"scripts": {
44
"pretest": "node tools/dev/checkSharedExtractionGuard.mjs",
55
"test": "node ./scripts/run-node-tests.mjs",
6+
"test:audit:locations": "node ./scripts/audit-playwright-test-locations.mjs",
67
"test:lanes": "node ./scripts/run-targeted-test-lanes.mjs",
8+
"test:lanes:preflight": "node ./scripts/audit-playwright-test-locations.mjs",
79
"test:lane:workspace-contract": "node ./scripts/run-targeted-test-lanes.mjs --lane workspace-contract",
810
"test:lane:tool-runtime": "node ./scripts/run-targeted-test-lanes.mjs --lane tool-runtime",
911
"test:lane:integration": "node ./scripts/run-targeted-test-lanes.mjs --lane integration",

0 commit comments

Comments
 (0)