mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-08 21:49:45 +08:00
fix(windows-ci): broaden bin/ pattern to match path.join(ROOT, 'bin')
Round 6. Round 5 tightened the bin/ pattern to require a script-name segment
after 'bin', which inadvertently released test/brain-sync.test.ts that uses:
const BIN = path.join(ROOT, 'bin');
const full = bin.startsWith('/') ? bin : path.join(BIN, bin);
The 'bin' segment is the LAST argument to path.join — there's no literal
script name to match. The earlier looser pattern caught this; round 5
broke that.
Fix: revert to `,\\s*['"]bin['"]\\s*[,)]` which matches both forms:
- `, 'bin', 'script-name')` (path.join with name) — typical
- `, 'bin')` (path.join ending at bin) — brain-sync style
Curated subset: 73 → 66 tests (~52% of free suite). The 7 additional
exclusions are all bin-script tests that were misclassified by the round-5
tightening.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -66,11 +66,12 @@ const WINDOWS_FRAGILE_PATTERNS: Array<{ pattern: RegExp; reason: string }> = [
|
|||||||
// Tests that spawn a bash shebang script in bin/ via spawnSync. Git Bash on
|
// Tests that spawn a bash shebang script in bin/ via spawnSync. Git Bash on
|
||||||
// Windows can run `bash /path/to/script` but spawnSync(scriptPath, ...)
|
// Windows can run `bash /path/to/script` but spawnSync(scriptPath, ...)
|
||||||
// tries to execute the file directly via CreateProcess, which fails on the
|
// tries to execute the file directly via CreateProcess, which fails on the
|
||||||
// shebang. The pattern matches any path-join with a 'bin' segment as a
|
// shebang. The pattern matches `, 'bin'` as a path-join argument (closing
|
||||||
// separator-bounded literal. Catches both `path.join(ROOT, 'bin', ...)` and
|
// OR followed by another segment), which catches:
|
||||||
// the destructured `join(import.meta.dir, '..', 'bin', ...)` form used in
|
// - path.join(ROOT, 'bin', 'script-name') — typical
|
||||||
// diff-scope.test.ts.
|
// - join(import.meta.dir, '..', 'bin', 'name') — destructured (diff-scope)
|
||||||
{ pattern: /,\s*['"]bin['"]\s*,\s*['"][a-z][\w-]+/, reason: 'spawns bin/ shebang script (Windows CreateProcess does not parse shebangs)' },
|
// - path.join(ROOT, 'bin') — bare BIN constant (brain-sync)
|
||||||
|
{ pattern: /,\s*['"]bin['"]\s*[,)]/, reason: 'spawns bin/ shebang script (Windows CreateProcess does not parse shebangs)' },
|
||||||
// Tests that launch a real Playwright browser. The windows-free-tests CI job
|
// Tests that launch a real Playwright browser. The windows-free-tests CI job
|
||||||
// runs a curated subset that intentionally does NOT install Chromium —
|
// runs a curated subset that intentionally does NOT install Chromium —
|
||||||
// browser bring-up on Windows is a separate concern (see PR #1238). Tests
|
// browser bring-up on Windows is a separate concern (see PR #1238). Tests
|
||||||
|
|||||||
Reference in New Issue
Block a user