Skip to content

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

test(nextest-coverage): cover ignored-only binaries in inventory checks

Steven Enamakeled52da051dd4
diff --git a/scripts/__tests__/nextest-coverage.test.mjs b/scripts/__tests__/nextest-coverage.test.mjs
index ad8883a6dd..31896941ad 100644
--- a/scripts/__tests__/nextest-coverage.test.mjs
+++ b/scripts/__tests__/nextest-coverage.test.mjs
@@ -7,11 +7,12 @@ import test from "node:test";
const root = path.resolve(import.meta.dirname, "../..");
const validator = path.join(root, "scripts/ci/nextest-report.mjs");
-function report(xml, expected = []) {
+function report(xml, expected = [], inventory) {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "nextest-report-"));
try {
fs.writeFileSync(`${dir}/junit.xml`, xml);
fs.writeFileSync(`${dir}/expected`, expected.join("\n"));
+ if (inventory) fs.writeFileSync(`${dir}/inventory.json`, JSON.stringify(inventory));
let status = 0;
try {
execFileSync(
@@ -21,6 +22,7 @@ function report(xml, expected = []) {
`${dir}/junit.xml`,
`${dir}/counts.json`,
`${dir}/expected`,
+ ...(inventory ? [`${dir}/inventory.json`] : []),
],
{ stdio: "pipe" },
);
@@ -65,3 +67,16 @@ test("nextest serialization retains JSON-RPC and multi-server suites", () => {
assert.match(config, /binary\(=json_rpc_e2e\)/);
assert.match(config, /binary\(=mcp_registry_multi_server\)/);
});
+
+test("ignored-only binaries remain inventoried without requiring nonexistent JUnit suites", () => {
+ const xml = '<testsuites><testsuite name="openhuman-cli::active" tests="1"/></testsuites>';
+ const inventory = { "rust-suites": {
+ active: { "binary-name": "active", testcases: { runs: { ignored: false, "filter-match": { status: "matches" } } } },
+ ignored: { "binary-name": "ignored", testcases: { live: { ignored: true, "filter-match": { status: "mismatch", reason: "ignored" } } } },
+ } };
+ assert.equal(report(xml, ["active", "ignored"], inventory).status, 0);
+ assert.equal(report(xml, ["active", "ignored", "missing"], inventory).status, 1);
+ inventory["rust-suites"].ignored.testcases.live.ignored = false;
+ inventory["rust-suites"].ignored.testcases.live["filter-match"].status = "matches";
+ assert.equal(report(xml, ["active", "ignored"], inventory).status, 1);
+});