Unify trunk on main: initialization → main #3
@@ -50,15 +50,6 @@ export interface Receipt {
|
||||
*/
|
||||
export const endToEnd = "test/integration/mesh.test.ts";
|
||||
|
||||
/**
|
||||
* canary is the short run that goes first.
|
||||
*
|
||||
* One machine, three images, one path walked end to end. **A suite that takes forty minutes is a
|
||||
* suite you hear from once a day** — and every fault found on 2026-09-01 would have shown up in
|
||||
* the first three minutes of it. Running this first means a broken change costs minutes.
|
||||
*/
|
||||
export const canary = "test/integration/canary.test.ts";
|
||||
|
||||
/** Where the receipt lives: XDG state, which is for exactly this — data a tool keeps between runs. */
|
||||
export function receiptPath(): string {
|
||||
const state = process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state");
|
||||
|
||||
+9
-18
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
import { spawn } from "node:child_process";
|
||||
import { canary, endToEnd, record } from "./lastrun.ts";
|
||||
import { endToEnd, record } from "./lastrun.ts";
|
||||
import { rebuild } from "./rebuild.ts";
|
||||
|
||||
/** counted is what the runner said, or nulls when it said nothing recognisable. */
|
||||
@@ -44,24 +44,15 @@ export async function runSuite(args: string[]): Promise<number> {
|
||||
if (built.length > 0) console.log(`built: ${built.join(", ")}\n`);
|
||||
}
|
||||
|
||||
// **The canary first, and stop if it dies.** It walks one path on one machine: a mesh comes up,
|
||||
// a module lands, a consumer gets a credential it can use. Everything that broke on
|
||||
// 2026-09-01 broke on that path, and finding out took forty minutes each time because the long
|
||||
// run had to reach it.
|
||||
// **No canary.** There was one: a second scenario, one machine, raised first so a broken mesh
|
||||
// failed in two minutes rather than in forty. It walked exactly the path the first three tests
|
||||
// of the long run walk — a mesh comes up, a module lands, a consumer gets a credential — and
|
||||
// the long run reaches the end of that path in about 160 seconds.
|
||||
//
|
||||
// Skipped when the caller named its own files — they asked for something specific — and when
|
||||
// the canary is itself what was asked for.
|
||||
if (ran.length === 0) {
|
||||
const first = await runFiles([canary]);
|
||||
if (first.code !== 0) {
|
||||
console.log(
|
||||
`\nthe canary failed, so the rest was not run. It is one machine and one path: a mesh ` +
|
||||
`comes up, a module lands, a consumer gets a credential. Fix that first — the long ` +
|
||||
`suite would fail on the same thing forty minutes later.`);
|
||||
return first.code;
|
||||
}
|
||||
console.log("");
|
||||
}
|
||||
// So it cost a whole scenario, every passing run, to save about 45 seconds on a failing one.
|
||||
// A scenario is three machines including a registry that boots a kernel to serve files, which
|
||||
// is where the two minutes went. `test/integration/canary.test.ts` is still there and still
|
||||
// runs when it is named; it is no longer raised on the way to everything else.
|
||||
|
||||
const { code, seen } = await runFiles(files);
|
||||
console.log("\n" + reportOn(counted(seen), (p, f) => record(p, f, files)));
|
||||
|
||||
Reference in New Issue
Block a user