rvlib-shipkit 0.38.0 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/suite/judge-suites.ts +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.38.1
|
|
2
|
+
|
|
3
|
+
- **The suite runner no longer refuses the test arguments of a repo with no `tests` block.** The floor spawns `bun suite-cli.ts [flags] -- <bun test args>`, and bun swallows a LEADING `--`. With no declaration there are no flags before it, so the runner saw `src/ tests/` bare and answered `unknown flag src/`, and a `bun test <args>` script with no `tests` block had a dead test slot on 0.38.0. The runner's own flags now end at `--` or at the first token that is not one of them. Pinned by a test fed both shapes, with a `bun test` flag and a separated declaration as controls.
|
|
4
|
+
|
|
1
5
|
## 0.38.0
|
|
2
6
|
|
|
3
7
|
- **A plain `bun test` floor runs its suites in parallel and times each one against a budget.** The floor `test` slot used to spawn `bun run test:raw`, which is one bun process running every suite on one core. Measured on a field repo: 71 suites in 74s, then a SIGKILL reported as `exited with code 1`, against 19.5s for the same suites in parallel workers. When the body is a literal `bun test …` (no cd, env prefix, pipe, quote or substitution, `--flag=value` allowed), the slot now runs `src/suite/suite-cli.ts`: every suite in `--parallel` workers, then the suites declared `serial` one at a time, with bun's own per-suite `--timings` read back. In the quick tier, the one every edit waits on, a suite over `repo.config.ts tests.budgetMs` (default 2000ms) runs again alone, and FAILs the task only when that alone timing is still over and it is not declared in `tests.slow` with `catches` (what no fast test catches) and `whyNotFast`. The quick tier leaves declared slow suites out, the full tier runs them, and a declared suite that runs under half the budget prints a WARN to drop the declaration without blocking. The full tier fails nothing on time and reports its three slowest suites. The full tier also runs one suite at a time: its suites spawn git and whole gates, and in parallel they measured slower than sequential and timed out. A killed suite prints `killed by SIGKILL while running <suite>`, from a crashed parallel worker or from the serial phase. The headline keeps `Ran N tests`. Any other script body runs as written, and the gate prints `skip: suite runner (…)` saying it is neither parallel nor timed. `defineRepo` refuses a declaration with a blank reason, a path outside the repo, a duplicate, or an unknown field, on the repo and on each `units[]` entry (paths relative to the unit), and the runner FAILs one naming a suite that does not exist.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rvlib-shipkit",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"funding": "https://github.com/sponsors/rvion",
|
|
5
5
|
"description": "All-in-one repo companion: ci gate (task DAG), auto-discovered health checks, release-contract fulfillness, asks queue, md-wiki tools, asset atelier, live tui",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,6 +28,7 @@ export const DEFAULT_BUDGET_MS = 2000
|
|
|
28
28
|
const TESTS_KEYS = ['budgetMs', 'slow', 'serial']
|
|
29
29
|
const SLOW_KEYS = ['file', 'catches', 'whyNotFast']
|
|
30
30
|
const SERIAL_KEYS = ['file', 'why']
|
|
31
|
+
const OWN_FLAGS = ['--budget-ms', '--slow', '--serial', '--declared-in']
|
|
31
32
|
|
|
32
33
|
export const normSuitePath = (file: string): string => posix.normalize(file.replace(/\\/g, '/')).replace(/^\.\//, '')
|
|
33
34
|
|
|
@@ -57,20 +58,23 @@ export function suiteFlags(t: TestsConfig | undefined): string[] {
|
|
|
57
58
|
export function parseSuiteFlags(argv: string[]): { tests: TestsConfig; rawArgs: string[]; declaredIn: string } | string {
|
|
58
59
|
const tests: Required<TestsConfig> = { budgetMs: DEFAULT_BUDGET_MS, slow: [], serial: [] }
|
|
59
60
|
let declaredIn = 'repo.config.ts tests'
|
|
61
|
+
// the runner's own flags end at `--` OR at the first token that is not one
|
|
62
|
+
// of them: bun swallows a LEADING `--`, so a repo with no declaration hands
|
|
63
|
+
// over the `bun test` arguments with no separator at all
|
|
60
64
|
let i = 0
|
|
61
|
-
for (; i < argv.length
|
|
65
|
+
for (; i < argv.length; i += 2) {
|
|
62
66
|
const flag = argv[i]!
|
|
67
|
+
if (flag === '--') { i++; break }
|
|
68
|
+
if (!OWN_FLAGS.includes(flag)) break
|
|
63
69
|
const value = argv[i + 1]
|
|
64
70
|
if (value == null || value === '--') return `${flag} needs a value`
|
|
65
|
-
i++
|
|
66
71
|
if (flag === '--budget-ms') tests.budgetMs = Number(value)
|
|
67
72
|
else if (flag === '--slow') tests.slow.push({ file: value, catches: '(declared)', whyNotFast: '(declared)' })
|
|
68
73
|
else if (flag === '--serial') tests.serial.push({ file: value, why: '(declared)' })
|
|
69
|
-
else
|
|
70
|
-
else return `unknown flag ${flag}`
|
|
74
|
+
else declaredIn = value
|
|
71
75
|
}
|
|
72
76
|
if (!(tests.budgetMs > 0)) return '--budget-ms must be a positive number'
|
|
73
|
-
return { tests, rawArgs: argv.slice(i
|
|
77
|
+
return { tests, rawArgs: argv.slice(i), declaredIn }
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
/** what `bun test` receives in each phase. The serial phase names its files
|