fix: mark accepted Mantis remote runs

This commit is contained in:
Peter Steinberger
2026-05-05 21:21:43 +01:00
parent d65d401c29
commit c319f3c4d5
2 changed files with 17 additions and 2 deletions

View File

@@ -472,10 +472,16 @@ describe("mantis Slack desktop smoke runtime", () => {
expect(result.status).toBe("pass");
const summary = JSON.parse(await fs.readFile(result.summaryPath, "utf8")) as {
status: string;
timings: { phases: { name: string; status: string }[] };
warning?: string;
};
expect(summary.status).toBe("pass");
expect(summary.warning).toBeUndefined();
expect(summary.timings.phases).toEqual(
expect.arrayContaining([
expect.objectContaining({ name: "crabbox.remote_run", status: "accepted" }),
]),
);
});
it("copies the screenshot before reporting a failed remote Slack QA run", async () => {

View File

@@ -113,7 +113,7 @@ type MantisPhaseTiming = {
finishedAt: string;
name: string;
startedAt: string;
status: "fail" | "pass";
status: "accepted" | "fail" | "pass";
};
type MantisPhaseTimings = {
@@ -203,7 +203,13 @@ function createPhaseTimer(startedAt: Date) {
totalMs: now.getTime() - origin,
};
}
return { recordPhase, snapshot, timePhase };
function updatePhaseStatus(name: string, status: MantisPhaseTiming["status"]) {
const phase = phases.findLast((entry) => entry.name === name);
if (phase) {
phase.status = status;
}
}
return { recordPhase, snapshot, timePhase, updatePhaseStatus };
}
function defaultOutputDir(repoRoot: string, startedAt: Date) {
@@ -1034,6 +1040,9 @@ export async function runMantisSlackDesktopSmoke(
}
const gatewaySetupCompleted =
gatewaySetup && remoteMetadata?.qaExitCode === 0 && remoteMetadata.gatewayAlive === true;
if (remoteRunError && gatewaySetupCompleted) {
timer.updatePhaseStatus("crabbox.remote_run", "accepted");
}
if (remoteRunError && !gatewaySetupCompleted) {
throw remoteRunError;
}