You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(ci): derive the audit list and stop shelling out through bunx
Review pass over the audit runner and the tool guards.
The audit list was hand-maintained alongside package.json with nothing linking
them, and it had already drifted: check:cron-parity exists, passes, and ran in no
CI step at all. The list is now derived from the check:* scripts with an explicit
exclusion map, so a new audit is opted out deliberately rather than forgotten.
That picks up cron-parity — 22 audits now, not 21.
check-realtime-prune-graph.ts still shelled out through `bunx turbo`, the same
pattern that took the bridge audit from 1s to 39s once the audits ran
concurrently. Both now go through scripts/local-bin.ts, which resolves
node_modules/.bin — the same path check:native-typecheck asserts is the native
TypeScript 7 compiler, so the one guarded path is the one that runs.
Audits are spawned as their script rather than `bun run <name>`, which started a
bun process only to read package.json and start a second one.
Tool detection is memoized per process; it was re-spawning python3 on each of the
5 call sites, in every vitest worker. The CI throw is deliberately NOT memoized —
memoizing it would turn every call after the first into a silent skip, which is
the failure mode the guard exists to prevent. Verified it still throws for all
three guarded tests, not just the first.
Also: dropped the environment module from the @sim/testing barrel so
node:child_process stays out of unrelated consumers' module graphs, restored the
per-audit reporting the 21 separate steps used to give (collapsible groups, error
annotations, and a timing table they never had), and trimmed comments that
restated their code or duplicated the runner's own docs.
`${tool} is required to run this suite and was not found. CI must never skip these tests — they cover behavior that is only observable by running the real tool. ${hint}`
36
-
)
37
-
}
38
-
if(!warned.has(tool)){
39
-
warned.add(tool)
40
-
console.warn(`[@sim/testing] Skipping tests that require ${tool}. ${hint}`)
17
+
/**
18
+
* Wraps a probe so it runs at most once per process, warns at most once, and always throws
19
+
* under CI — memoizing the throw would turn every call after the first into a silent skip.
`${label} is required to run this suite and was not found. CI must never skip these tests — they cover behavior that is only observable by running the real tool. ${result.hint}`
30
+
)
31
+
}
32
+
if(!warned){
33
+
warned=true
34
+
console.warn(`[@sim/testing] Skipping tests that require ${label}. ${result.hint}`)
35
+
}
36
+
returnfalse
41
37
}
42
-
returnfalse
43
-
}
44
-
45
-
/** Parses `python3 --version`, returning null when the interpreter is missing or unreadable. */
consthint=`Found ${version ? `${version.major}.${version.minor}` : 'no python3 on PATH'}. Install a newer Python (e.g. \`brew install python@3.13\`) and put it on PATH ahead of /usr/bin.`
hint: `Found ${found ? `${found.major}.${found.minor}` : 'no python3 on PATH'}. Install a newer Python (e.g. \`brew install python@3.13\`) and put it on PATH ahead of /usr/bin.`,
0 commit comments