Skip to content

Commit c319f3c

Browse files
committed
fix: mark accepted Mantis remote runs
1 parent d65d401 commit c319f3c

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,16 @@ describe("mantis Slack desktop smoke runtime", () => {
472472
expect(result.status).toBe("pass");
473473
const summary = JSON.parse(await fs.readFile(result.summaryPath, "utf8")) as {
474474
status: string;
475+
timings: { phases: { name: string; status: string }[] };
475476
warning?: string;
476477
};
477478
expect(summary.status).toBe("pass");
478479
expect(summary.warning).toBeUndefined();
480+
expect(summary.timings.phases).toEqual(
481+
expect.arrayContaining([
482+
expect.objectContaining({ name: "crabbox.remote_run", status: "accepted" }),
483+
]),
484+
);
479485
});
480486

481487
it("copies the screenshot before reporting a failed remote Slack QA run", async () => {

extensions/qa-lab/src/mantis/slack-desktop-smoke.runtime.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ type MantisPhaseTiming = {
113113
finishedAt: string;
114114
name: string;
115115
startedAt: string;
116-
status: "fail" | "pass";
116+
status: "accepted" | "fail" | "pass";
117117
};
118118

119119
type MantisPhaseTimings = {
@@ -203,7 +203,13 @@ function createPhaseTimer(startedAt: Date) {
203203
totalMs: now.getTime() - origin,
204204
};
205205
}
206-
return { recordPhase, snapshot, timePhase };
206+
function updatePhaseStatus(name: string, status: MantisPhaseTiming["status"]) {
207+
const phase = phases.findLast((entry) => entry.name === name);
208+
if (phase) {
209+
phase.status = status;
210+
}
211+
}
212+
return { recordPhase, snapshot, timePhase, updatePhaseStatus };
207213
}
208214

209215
function defaultOutputDir(repoRoot: string, startedAt: Date) {
@@ -1034,6 +1040,9 @@ export async function runMantisSlackDesktopSmoke(
10341040
}
10351041
const gatewaySetupCompleted =
10361042
gatewaySetup && remoteMetadata?.qaExitCode === 0 && remoteMetadata.gatewayAlive === true;
1043+
if (remoteRunError && gatewaySetupCompleted) {
1044+
timer.updatePhaseStatus("crabbox.remote_run", "accepted");
1045+
}
10371046
if (remoteRunError && !gatewaySetupCompleted) {
10381047
throw remoteRunError;
10391048
}

0 commit comments

Comments
 (0)