@rightkit/release 0.6.36 → 0.6.38
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/deterministic-scans.mjs +8 -2
- package/local-publish.mjs +43 -0
- package/package.json +1 -1
- package/rightkit-versions.json +2 -2
package/deterministic-scans.mjs
CHANGED
|
@@ -1775,6 +1775,10 @@ export function defaultSpawnAsync(command, args, options = {}) {
|
|
|
1775
1775
|
/** null when a test summary is evidence of a pass; otherwise { code, detail }. Used for fresh and cached test rows alike. */
|
|
1776
1776
|
export function testResultsProblem(results) {
|
|
1777
1777
|
if (!results) return { code: "NO_TEST_SUMMARY", detail: "no test counts recorded" };
|
|
1778
|
+
// End-to-end tests only (Adrian, 2026-11-03: "End to end tests ONLY any unit tests need strict approval along with evidence and
|
|
1779
|
+
// reason"): a Rust crate whose test build runs no test is a pass, recorded with its zero counts. A test that failed still fails, and a
|
|
1780
|
+
// run whose tests were all skipped or ignored still proves nothing (ALL_SKIPPED below). node:test and vitest rows are unchanged.
|
|
1781
|
+
if (results.runner === "libtest" && !(results.tests > 0) && !(results.fail > 0)) return null;
|
|
1778
1782
|
if (!(results.tests > 0)) return { code: "NO_TESTS", detail: "the test scan executed no test" };
|
|
1779
1783
|
if (results.fail > 0) return { code: "SUMMARY_FAILED", detail: `the test runner exited 0 but its summary reports ${results.fail} failed test(s)` };
|
|
1780
1784
|
// A suite that ran tests but passed none of them (every test skipped or todo) proves nothing (D17, rightkit#1236).
|
|
@@ -3045,8 +3049,10 @@ export async function runScans(plan, options = {}) {
|
|
|
3045
3049
|
if (listingCut) fail("TEST_LISTING", `${s.id}: the compile listing was cut at the kept output tail, so the test executables cannot be enumerated`);
|
|
3046
3050
|
else if (listing.buildFinished !== true) fail("TEST_LISTING", `${s.id}: the compile exited 0 but its listing has no successful build-finished record (${listing.buildFinished === false ? "a build-finished record said failure" : "none found"})`);
|
|
3047
3051
|
else if (listing.binaries.length === 0) {
|
|
3048
|
-
//
|
|
3049
|
-
|
|
3052
|
+
// End-to-end tests only (Adrian, 2026-11-03): a crate whose test build lists no test executable has no test to run; the row passes
|
|
3053
|
+
// with zero libtest counts, the same as a test build that runs none (testResultsProblem).
|
|
3054
|
+
row.results = { runner: "libtest", tests: 0, pass: 0, fail: 0, skipped: 0, todo: 0, binaries: 0 };
|
|
3055
|
+
detail = `${s.id}: no test executable (${listing.artifacts} artifact record(s)); end-to-end tests only, nothing to run`;
|
|
3050
3056
|
} else {
|
|
3051
3057
|
let boundDirs; let generationRoots = null;
|
|
3052
3058
|
if (viaSnapshotBroker) { boundDirs = row.snapshotEvidence?.outputDir ? [row.snapshotEvidence.outputDir] : []; generationRoots = deps.snapshotBroker.outputRoots ?? []; }
|
package/local-publish.mjs
CHANGED
|
@@ -43,6 +43,35 @@ export const LOCAL_HOST_POLICIES = Object.freeze({ darwin: "darwin-only", win32:
|
|
|
43
43
|
const localHostPolicyReason = (platform) => (platform === "win32" ? LOCAL_WIN32_HOST_POLICY_REASON : platform === "linux" ? LOCAL_LINUX_HOST_POLICY_REASON : LOCAL_HOST_POLICY_REASON);
|
|
44
44
|
const STEP_TIMEOUT_MS = 30 * 60 * 1000;
|
|
45
45
|
|
|
46
|
+
/** The broker's reply to a `cargo test` it compiled and did not run (GATE-CONTRACT GC-A08). */
|
|
47
|
+
export const BROKER_COMPILED_ONLY = /^rustright: compiled, ready for testing\b/m;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Run the test executables a broker-compiled `cargo test` step listed, outside the broker (GC-A08), with the run arguments after its `--`.
|
|
51
|
+
* The listing must have finished and name at least one test executable; every executable must sit inside the compile's output directory
|
|
52
|
+
* (the carried receipt's, else cargo metadata's target directory). Returns runTestBinaries' { status, code?, detail?, results }.
|
|
53
|
+
*/
|
|
54
|
+
export async function runCompiledTests({ unit, step, result, cwd, env, scans }) {
|
|
55
|
+
const ds = scans ?? await import("./deterministic-scans.mjs");
|
|
56
|
+
const { resolveTargetRoot } = await import("./cargo-target.mjs");
|
|
57
|
+
const listing = ds.parseTestListing(`${result.stdout ?? ""}`);
|
|
58
|
+
if (listing.buildFinished !== true) return { status: "fail", code: "TEST_LISTING", detail: `${unit}: the compile has no successful build-finished record`, results: null };
|
|
59
|
+
if (listing.binaries.length === 0) return { status: "fail", code: "NO_TEST_EXECUTABLES", detail: `${unit}: the compile listed no test executable (${listing.artifacts} artifact record(s))`, results: null };
|
|
60
|
+
const outputDir = typeof result.outputDir === "string" ? result.outputDir : resolveTargetRoot(path.join(cwd, "Cargo.toml"), { env });
|
|
61
|
+
const contained = ds.containTestExecutables(listing.binaries, { boundDirs: [outputDir] });
|
|
62
|
+
if (contained.problems.length) return { status: "fail", code: "TEST_EXECUTABLE_OUTSIDE_OUTPUT", detail: `${unit}: ${contained.problems.slice(0, 5).join("; ")}; nothing was run`, results: null };
|
|
63
|
+
const sep = step.args.indexOf("--");
|
|
64
|
+
const runArgs = sep >= 0 ? step.args.slice(sep + 1) : [];
|
|
65
|
+
const scan = { id: `test:${unit}`, runOutside: { args: runArgs } };
|
|
66
|
+
// Each executable's output is kept so the caller's ResultScanner still counts SKIP markers (an asset-gated proof that returned early).
|
|
67
|
+
const outputs = [];
|
|
68
|
+
const spawn = async (...a) => { const r = await ds.defaultSpawnAsync(...a); outputs.push(r); return r; };
|
|
69
|
+
// A serial step stays serial across executables, as `cargo test -- --test-threads=1` runs them one after another.
|
|
70
|
+
const concurrency = runArgs.includes("--test-threads=1") ? 1 : undefined;
|
|
71
|
+
const ran = await ds.runTestBinaries({ scan, binaries: contained.accepted, spawn, env, limitMs: STEP_TIMEOUT_MS, ...(concurrency ? { concurrency } : {}) });
|
|
72
|
+
return { ...ran, outputs };
|
|
73
|
+
}
|
|
74
|
+
|
|
46
75
|
export class LocalPublishError extends Error {
|
|
47
76
|
constructor(message) { super(message); this.name = "LocalPublishError"; }
|
|
48
77
|
}
|
|
@@ -698,6 +727,20 @@ async function* publishUnitStages(parsed, deps, batch) {
|
|
|
698
727
|
refuse(`${plan.id} step failed (${result.error?.message ?? `exit ${result.status}`}): ${commandText}\nstdout:\n${result.stdout ?? ""}\nstderr:\n${result.stderr ?? ""}`);
|
|
699
728
|
}
|
|
700
729
|
row.ok = true;
|
|
730
|
+
// GATE-CONTRACT GC-A08: a broker compiles a `cargo test` and never runs it. Its reply names that; the executables its JSON listing
|
|
731
|
+
// names are then run here, outside the broker, exactly as the gate's class B test rows run them (runCompiledTests).
|
|
732
|
+
if (row.isTest && step.command === "cargo" && BROKER_COMPILED_ONLY.test(`${result.stderr ?? ""}\n${result.stdout ?? ""}`)) {
|
|
733
|
+
const ran = await (deps.runCompiledTests ?? runCompiledTests)({ unit, step, result, cwd: stepCwd, env: step.env ? { ...env, ...step.env } : env });
|
|
734
|
+
if (ran.status !== "pass") { steps.push(row); refuse(`${plan.id} tests not run or failed (${ran.code}): ${ran.detail}`); }
|
|
735
|
+
// SKIP markers come from the executables' own output, read the way the old in-cargo run was read.
|
|
736
|
+
// An output cut at the kept tail could hide an early SKIP line; such a run proves nothing.
|
|
737
|
+
if ((ran.outputs ?? []).some((o) => o?.truncated === true)) { steps.push(row); refuse(`${plan.id}: a test executable's output exceeded the kept tail, so its SKIP markers cannot be counted`); }
|
|
738
|
+
const marks = new ResultScanner(); for (const o of ran.outputs ?? []) { marks.push(`${o?.stdout ?? ""}\n`); marks.push(`${o?.stderr ?? ""}\n`); }
|
|
739
|
+
const scanned = marks.finish();
|
|
740
|
+
Object.assign(row, { executed: ran.results.pass, failed: ran.results.fail, ignored: ran.results.skipped, skipped: scanned.skipped, binaries: ran.results.binaries });
|
|
741
|
+
steps.push(row);
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
701
744
|
if (row.isTest) {
|
|
702
745
|
const out = new ResultScanner(); const err = new ResultScanner();
|
|
703
746
|
out.push(result.stdout ?? ""); err.push(result.stderr ?? "");
|
package/package.json
CHANGED
package/rightkit-versions.json
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@rightkit/qa": "0.6.2",
|
|
50
50
|
"@rightkit/qa-chrome": "0.1.12",
|
|
51
51
|
"@rightkit/react-shell": "0.7.2",
|
|
52
|
-
"@rightkit/release": "0.6.
|
|
52
|
+
"@rightkit/release": "0.6.38",
|
|
53
53
|
"@rightkit/settings-ui": "0.7.0",
|
|
54
54
|
"@rightkit/social-ui": "0.1.0",
|
|
55
55
|
"@rightkit/system-ui": "0.1.0",
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
"rightkit-agent-plugins": "0.1.0",
|
|
503
503
|
"rightkit-agent-policy": "0.1.0",
|
|
504
504
|
"rightkit-agent-recipes": "0.1.0",
|
|
505
|
-
"rightkit-agent-tools": "0.3.
|
|
505
|
+
"rightkit-agent-tools": "0.3.2",
|
|
506
506
|
"rightkit-agent-transcript": "0.1.0",
|
|
507
507
|
"rightkit-agents": "0.2.1",
|
|
508
508
|
"rightkit-ai-accounts": "0.1.0",
|