





















@@ -175,4 +175,67 @@ describe("mantis Slack desktop smoke runtime", () => {
175175expect(summary.error).toContain("remote Slack QA failed");
176176expect(summary.artifacts.screenshotPath).toContain("slack-desktop-smoke.png");
177177});
178+179+it("accepts Blacksmith Testbox lease ids from Crabbox warmup", async () => {
180+const commands: { args: readonly string[]; command: string }[] = [];
181+const runner = vi.fn(async (command: string, args: readonly string[]) => {
182+commands.push({ command, args });
183+if (command === "/tmp/crabbox" && args[0] === "warmup") {
184+return { stdout: "ready: tbx_abc-123_more\n", stderr: "" };
185+}
186+if (command === "/tmp/crabbox" && args[0] === "inspect") {
187+return {
188+stdout: `${JSON.stringify({
189+ host: "203.0.113.10",
190+ id: "tbx_abc-123_more",
191+ provider: "blacksmith-testbox",
192+ sshKey: "/tmp/key",
193+ sshPort: "2222",
194+ sshUser: "crabbox",
195+ state: "active",
196+ })}\n`,
197+stderr: "",
198+};
199+}
200+if (command === "rsync") {
201+const outputDir = args.at(-1);
202+await fs.mkdir(outputDir as string, { recursive: true });
203+if (String(outputDir).endsWith("slack-qa/")) {
204+await fs.writeFile(path.join(outputDir as string, "slack-qa-report.md"), "# Slack\n");
205+} else {
206+await fs.writeFile(path.join(outputDir as string, "slack-desktop-smoke.png"), "png");
207+await fs.writeFile(path.join(outputDir as string, "remote-metadata.json"), "{}\n");
208+await fs.writeFile(path.join(outputDir as string, "chrome.log"), "chrome\n");
209+await fs.writeFile(path.join(outputDir as string, "slack-desktop-command.log"), "qa\n");
210+}
211+}
212+return { stdout: "", stderr: "" };
213+});
214+215+const result = await runMantisSlackDesktopSmoke({
216+commandRunner: runner,
217+crabboxBin: "/tmp/crabbox",
218+now: () => new Date("2026-05-04T13:30:00.000Z"),
219+outputDir: ".artifacts/qa-e2e/mantis/slack-desktop-testbox",
220+provider: "blacksmith-testbox",
221+ repoRoot,
222+});
223+224+expect(result.status).toBe("pass");
225+expect(commands).toEqual(
226+expect.arrayContaining([
227+expect.objectContaining({
228+args: expect.arrayContaining(["--id", "tbx_abc-123_more"]),
229+command: "/tmp/crabbox",
230+}),
231+]),
232+);
233+const summary = JSON.parse(await fs.readFile(result.summaryPath, "utf8")) as {
234+crabbox: { id: string; provider: string };
235+};
236+expect(summary.crabbox).toMatchObject({
237+id: "tbx_abc-123_more",
238+provider: "blacksmith-testbox",
239+});
240+});
178241});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。