fix(ci): require live kova evidence

This commit is contained in:
Vincent Koc
2026-06-07 00:48:54 +02:00
parent 9564ee25b2
commit a9706ddef2
2 changed files with 52 additions and 8 deletions
@@ -10,6 +10,7 @@ type WorkflowStep = {
if?: string;
run?: string;
env?: Record<string, string>;
with?: Record<string, string>;
};
type WorkflowJob = {
@@ -67,4 +68,30 @@ describe("OpenClaw performance workflow", () => {
);
expect(runKova.run).not.toContain("report.summary?.statuses ?? {}");
});
it("fails selected live Kova lanes when live auth is missing", () => {
const configureAuth = findStep("Configure live OpenAI auth");
const runKova = findStep("Run Kova");
expect(configureAuth.if).toContain("matrix.live == 'true'");
expect(configureAuth.env?.OPENAI_API_KEY).toBe("${{ secrets.OPENAI_API_KEY }}");
expect(configureAuth.run).toContain('if [[ -z "${OPENAI_API_KEY:-}" ]]; then');
expect(configureAuth.run).toContain("cannot run without live evidence");
expect(configureAuth.run).toContain("exit 1");
expect(configureAuth.run).not.toContain("will be skipped");
expect(runKova.run).not.toContain('echo "skipped=true" >> "$GITHUB_OUTPUT"');
});
it("requires Kova evidence before uploading selected lane artifacts", () => {
const validateEvidence = findStep("Validate Kova evidence");
const upload = findStep("Upload Kova artifacts");
expect(validateEvidence.if).toContain("always()");
expect(validateEvidence.if).toContain("steps.lane.outputs.run == 'true'");
expect(validateEvidence.run).toContain('"$REPORT_DIR" -maxdepth 1 -type f -name');
expect(validateEvidence.run).toContain('"$BUNDLE_DIR/bundle.json"');
expect(validateEvidence.run).toContain('"$SUMMARY_DIR/${LANE_ID}.md"');
expect(validateEvidence.run).toContain("exit 1");
expect(upload.with?.["if-no-files-found"]).toBe("error");
});
});