commit 0ebc7d03acd7b9f82e9be1a84f72433da27aaf3b
parent 265b55920af9ce9d52ff5b9ef23842cc5cbf0e0b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 25 Sep 2026 12:36:18 -0400
editor e2e: deploy-hub's unbuilt refusal is checked only when this checkout holds no hub build — export/out is the checkout's real build dir, so after e2e:2origin the call would start a real deploy
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/editor/e2e/ops-api.spec.ts b/editor/e2e/ops-api.spec.ts
@@ -986,13 +986,28 @@ test("deploy-hub refuses no project, the homepage's project, and a bundle that i
expect(homepages.body.error).toContain('"archilyzer", which is the Archilyzer homepage\'s');
// A real project, but export/out holds no hub: never built here, or a
- // site's bundle (shared directory).
+ // site's bundle (shared directory). `export/out` is the CHECKOUT's build dir
+ // (resolveOutDir is not fixture-controlled), so in a checkout that holds a
+ // hub build — e.g. after `e2e:2origin` built one — the refusal cannot fire,
+ // and the call would start a REAL deploy of that hub. The sub-case is then
+ // recorded as not exercisable here and never run.
await writeFile(hubFile, JSON.stringify({ cloudflareProject: "archilyzer-hub" }));
- const unbuilt = await ops(request, "deploy-hub", { preview: "hub-check" });
- expect(unbuilt.status).toBe(400);
- expect(unbuilt.body.error).toMatch(
- /export\/out holds (no hub build|a build of ".*", not the hub) — build the hub first/,
- );
+ const hubBuiltHere =
+ (await pathExists("../export/out/hub-sites.json")) &&
+ !(await pathExists("../export/out/site.json"));
+ if (hubBuiltHere) {
+ test.info().annotations.push({
+ type: "subcase-not-exercisable",
+ description:
+ "export/out holds a hub build in this checkout, so the unbuilt refusal cannot fire (and the call would deploy it)",
+ });
+ } else {
+ const unbuilt = await ops(request, "deploy-hub", { preview: "hub-check" });
+ expect(unbuilt.status).toBe(400);
+ expect(unbuilt.body.error).toMatch(
+ /export\/out holds (no hub build|a build of ".*", not the hub) — build the hub first/,
+ );
+ }
// build-hub: a preview without a deploy is a mistake, not a build.
const previewOnly = await ops(request, "build-hub", { preview: "hub-check" });