@@ -519,7 +519,40 @@ await runLoud(["bun", "run", "audit:high"]);
519519console . log ( "→ typecheck" ) ;
520520await runLoud ( [ "bun" , "x" , "tsc" , "--noEmit" ] ) ;
521521console . log ( "→ test suite" ) ;
522- await runLoud ( [ "bun" , "test" , "--isolate" , "tests" ] ) ;
522+ // Match CI's isolation policy instead of inventing a second one. `ci.yml` runs
523+ // the storage-policy and api-usage harnesses in DEDICATED jobs and excludes them
524+ // from the general shards (`scripts/ci/run-bun-test-batches.sh`
525+ // `is_general_test_file`), because those Worker-heavy files corrupt the isolate
526+ // state around them.
527+ //
528+ // This preflight used to run `bun test --isolate tests` — the whole directory in
529+ // one process — so it exercised a grouping CI never runs. The result was a
530+ // release gate that failed on `api-usage` while every CI job for the same commit
531+ // was green: the worst kind of gate, one that blocks a good release and teaches
532+ // you to distrust it. Same files and same coverage as before (915), now in the
533+ // same groups CI uses.
534+ // Every command here stays a `bun` invocation. The release-helper suite shims
535+ // exactly `bun`, `gh`, `git` and `npm` onto a scratch PATH to record calls
536+ // without executing them; a `bash` step would miss that shim, escape into the
537+ // real suite, and fail the helper tests with exit 127.
538+ const ISOLATED_TEST_FILES = [
539+ "./tests/api-storage-policy-already-running.test.ts" ,
540+ "./tests/api-storage-policy-mutation-busy.test.ts" ,
541+ "./tests/api-storage-policy-put-race.test.ts" ,
542+ "./tests/api-storage-policy-run.test.ts" ,
543+ "./tests/api-storage-policy.test.ts" ,
544+ "./tests/api-storage.test.ts" ,
545+ "./tests/api-usage.test.ts" ,
546+ ] ;
547+ await runLoud ( [
548+ "bun" , "test" , "--isolate" , "tests" ,
549+ "--path-ignore-patterns=**/api-storage-policy*.test.ts" ,
550+ "--path-ignore-patterns=**/api-storage.test.ts" ,
551+ "--path-ignore-patterns=**/api-usage.test.ts" ,
552+ ] ) ;
553+ for ( const isolated of ISOLATED_TEST_FILES ) {
554+ await runLoud ( [ "bun" , "test" , "--isolate" , isolated ] ) ;
555+ }
523556console . log ( "→ privacy scan" ) ;
524557await runLoud ( [ "bun" , "run" , "privacy:scan" ] ) ;
525558
0 commit comments