Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): report coverage after failed tests and build tauri binary

Steven Enamakel4e3cc14b9c5f
diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjs
index fd9007cb8d..38b27a4229 100644
--- a/scripts/__tests__/self-hosted-lanes.test.mjs
+++ b/scripts/__tests__/self-hosted-lanes.test.mjs
@@ -1,6 +1,7 @@
// Self-test for the CI lane flow: scripts/ci/self-hosted/{lanes-plan,lanes}.mjs
// (run by ci-fast.yml / ci-fast-hosted.yml through ci-lanes.yml).
import assert from "node:assert/strict";
+import { spawnSync } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
@@ -395,6 +396,26 @@ test("private gates-off, storage, and Tauri execute equivalent coverage suites w
assert.equal(checks["tauri-coverage"].env.CARGO_BUILD_TARGET_DIR, "target/ci-private-coverage");
});
+test("private auxiliary coverage reports after failed tests and preserves the failure", () => {
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "lane-coverage-report-"));
+ const cargo = path.join(dir, "cargo");
+ const calls = path.join(dir, "calls");
+ fs.writeFileSync(cargo, '#!/bin/sh\necho "$*" >> "$CARGO_CALLS"\nif [ "$2" = nextest ]; then exit 17; fi\nexit 0\n', { mode: 0o755 });
+ const plan = buildPlan({ profile: "ex63", areas: ALL, env: EX63_ENV });
+ const check = plan.lanes.find((l) => l.name === "storage-drivers").checks[0];
+ const result = spawnSync("bash", ["-o", "pipefail", "-c", check.run], {
+ cwd: dir, env: { ...process.env, PATH: `${dir}:${process.env.PATH}`, CARGO_CALLS: calls },
+ });
+ assert.equal(result.status, 17);
+ const commands = fs.readFileSync(calls, "utf8").trim().split("\n");
+ assert.equal(commands.length, 2);
+ assert.match(commands[0], /^llvm-cov nextest /);
+ assert.match(commands[1], /^llvm-cov report /);
+ const tauri = plan.lanes.find((l) => l.name === "tauri");
+ assert.match(tauri.checks.find((c) => c.name === "build-tauri").run, /cargo build .*--bin OpenHuman/);
+ fs.rmSync(dir, { recursive: true, force: true });
+});
+
test("private runner serializes independent lanes after failures even when parallelism is requested", async () => {
const out = fs.mkdtempSync(path.join(os.tmpdir(), "lanes-private-"));
fs.mkdirSync(path.join(out, "logs"));
diff --git a/scripts/ci/self-hosted/lanes-plan.mjs b/scripts/ci/self-hosted/lanes-plan.mjs
index abe12f9d38..2626418482 100644
--- a/scripts/ci/self-hosted/lanes-plan.mjs
+++ b/scripts/ci/self-hosted/lanes-plan.mjs
@@ -613,7 +613,15 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {
check.run = coverageSuite(`${args}${expression}${serial}`, `lcov-${check.name}.info`);
}
}
- const tauri = lanes.find((l) => l.name === "tauri").checks.find((c) => c.name === "tauri-coverage");
+ const tauriLane = lanes.find((l) => l.name === "tauri");
+ // Clippy emits metadata only; a real uninstrumented link proves that
+ // Tauri-only changes also use the target linker checked by the workflow.
+ tauriLane.checks.splice(1, 0, {
+ name: "build-tauri",
+ when: areas.rustTauri,
+ run: "bash scripts/ci-cancel-aware.sh cargo build --manifest-path crates/openhuman-app/Cargo.toml --bin OpenHuman",
+ });
+ const tauri = tauriLane.checks.find((c) => c.name === "tauri-coverage");
tauri.env = { ...covEnv, CARGO_BUILD_TARGET_DIR: "target/ci-private-coverage" };
tauri.run = "unset RUSTFLAGS; " + coverageSuite("--manifest-path crates/openhuman-app/Cargo.toml", "lcov-tauri.info", "crates/openhuman-app/Cargo.toml");
}