Skip to content

Commit 272b196

Browse files
ci: serialize test files to avoid parallel dist/ build races
Multiple suites (cli.subprocess, help.snapshot, credentials lock) each run npm run build in beforeAll. With fileParallelism enabled, workers can corrupt dist/ mid-run and subprocess smoke tests flake with exit 1. Run build once in CI before npm test and disable vitest file parallelism.
1 parent 8587c77 commit 272b196

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
cache: 'npm'
5656

5757
- run: npm ci
58+
- run: npm run build
5859
- run: npm test
5960
env:
6061
CI: true

vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export default defineConfig({
44
test: {
55
include: ['src/**/*.{test,spec}.ts', 'test/**/*.{test,spec}.ts'],
66
exclude: ['test/dev-e2e/**', 'test/e2e/**', 'node_modules/**', 'dist/**'],
7+
// Subprocess/snapshot suites each run `npm run build` in beforeAll; parallel
8+
// file workers can race on dist/ and produce a stale binary (exit 1 vs 5 flakes).
9+
fileParallelism: false,
710
coverage: {
811
provider: 'v8',
912
reporter: ['text', 'text-summary', 'json-summary', 'html'],

0 commit comments

Comments
 (0)