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
{{ message }}
Repository navigation
CLI: a Bun repository's full command is bun test, which skips the package.json test script #189
diffci check, diffci coverage and diffci verify-workflow --enforce in a repository with bun.lock (or bun.lockb, or "packageManager": "bun@...").
Environment
Ubuntu, Node.js 24.22.1, Bun 1.x, terminal.
What happens
inferFullCommand (packages/diffci-cli/src/client/full-command.ts) returns bun test as the full command for a Bun repository, with the reason "package.json test script with Bun lockfile" (or "via bun").
bun test is not the package.json test script. It starts Bun's built-in test runner, which discovers *.test.* and *.spec.* files by itself and never reads scripts.test. bun run test runs the script. npm, pnpm and Yarn behave differently: for them <manager> test does run the script.
Minimal reproduction:
mkdir bun-repro &&cd bun-repro
echo'{"name":"p","private":true,"scripts":{"test":"node --test t/"}}'> package.json
mkdir t
echo'import test from "node:test"; test("from the script", () => {});'> t/a.test.mjs
echo'import { test, expect } from "bun:test"; test("bun only", () => expect(1).toBe(2));'> t/b.test.ts
touch bun.lock
bun test# runs Bun's runner over both files; t/b.test.ts fails; scripts.test is ignored
bun run test# runs `node --test t/`, the repository's real test command
So for a Bun repository whose script runs Vitest, Jest or node --test, the full-suite timing in check, the command coverage runs by default, and the full-suite fallback all run a different suite than CI does.
The enforce audit has the same assumption: normalizeTestCommand in src/client/workflow-guard.ts treats bun run test and bun test as the same command, so a workflow that only runs bun test is accepted as running the full suite on the default branch.
What you expected
The full command for a Bun repository is bun run test, and bun test is not treated as equivalent to it.
Regression test
packages/diffci-cli/tests/client/bun-full-command.test.ts in the linked pull request fails on main and passes with the fix.
Activity
fix(cli): accept bun test in the enforce audit when scripts.test is e…
fix(cli): run a Bun repository's test script with bun run test (DiffC…