Skip to content

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

test(scripts): cover ex63 scratch disk usage report at lane end

Steven Enamakel795cd3af84f6
diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjs
index 45b9fe2a69..862a12b993 100644
--- a/scripts/__tests__/self-hosted-lanes.test.mjs
+++ b/scripts/__tests__/self-hosted-lanes.test.mjs
@@ -23,6 +23,7 @@ import {
treeRssMiB,
Runner,
defaultHeavySlots,
+ diskUsageReport,
foldLine,
gatingFailures,
renderLaneTable,
@@ -1119,3 +1120,19 @@ test("storage checker and debt policy changes arm their own scripts lane", () =>
`${pattern} must arm the scripts area`,
);
});
+
+test("the ex63 profile logs where the scratch disk's space goes at each lane end", () => {
+ const seen = [];
+ const run = (cmd) => {
+ seen.push(cmd);
+ return cmd.startsWith("df") ? "Filesystem Size Used Avail\n/dev/vdb 160G 150G 10G" : "12G\ttarget/ci-private-coverage";
+ };
+ const report = diskUsageReport({ profile: "ex63", scratch: "/scratch", run });
+ assert.match(report, /df -h \/scratch/);
+ assert.match(report, /\/dev\/vdb 160G/);
+ assert.match(report, /du -sh target\/\*/);
+ assert.match(report, /12G\ttarget\/ci-private-coverage/);
+ assert.ok(seen.some((c) => c.includes("target/*")));
+ assert.equal(diskUsageReport({ profile: "hosted", scratch: "/scratch", run }), null);
+ assert.equal(diskUsageReport({ profile: "ex63", scratch: "", run }), null);
+});