fix(cli): browser ensure fails when the unzip leaves no Chrome executable (#5329)

* fix(cli): browser ensure fails when the unzip leaves no Chrome executable

* refactor(cli): keep install debug output and report only the last unzip attempt

* fix(cli): browser ensure exits after a failure or a --force download

* fix(cli): browser checks name why Chrome could not be installed

* fix(cli): render shows why its setup step failed instead of a crash dump

* refactor(cli): build the browser download label and staged test path once

* refactor(cli): one owner for the render setup result line

* fix(cli): render setup failures report through one error line

* refactor(cli): one reader and writer for both render setup lines
This commit is contained in:
Miguel Ángel
2026-10-09 16:21:46 +00:00
committed by GitHub
parent 46f6cb3567
commit 577bdf6701
11 changed files with 363 additions and 109 deletions
@@ -1,8 +1,8 @@
import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
import { runCancellableProcess } from "./cancellableProcess.js";
import { describe, expect, it, vi } from "vitest";
import { runCancellableProcess, runRenderSetupWorker } from "./cancellableProcess.js";
import { testProcessIsAlive, waitForTestCondition } from "./processTestUtils.js";
const IS_POSIX = process.platform !== "win32";
@@ -79,3 +79,16 @@ describe.skipIf(!IS_POSIX)("cancellable process tree teardown", () => {
}
}, 5_000);
});
describe("render setup worker failure", () => {
it("rejects with only the worker's reason, not its crash output", async () => {
const stderr = vi.spyOn(process.stderr, "write").mockImplementation(() => true);
try {
const failure = runRenderSetupWorker("bogus" as "lint", {}, {});
await expect(failure).rejects.toThrow(/^Unknown render setup mode: bogus$/);
} finally {
stderr.mockRestore();
}
});
});