test: align workspace regressions with durable pins

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-13 21:16:41 +00:00
1 parent 7a88de4887
commit ef1bf1a79b
5 files changed
+25 -6

No files matched your search

+3
View File
@@ -137,6 +137,9 @@ describe("secrets CLI helpers", () => {
delete process.env.PAPERCLIP_SECRETS_AWS_REGION;
delete process.env.AWS_REGION;
delete process.env.AWS_DEFAULT_REGION;
delete process.env.AWS_ACCESS_KEY_ID;
delete process.env.AWS_SECRET_ACCESS_KEY;
delete process.env.AWS_SESSION_TOKEN;
delete process.env.PAPERCLIP_SECRETS_AWS_DEPLOYMENT_ID;
delete process.env.PAPERCLIP_SECRETS_AWS_KMS_KEY_ID;
});
@@ -113,6 +113,7 @@ describe("claude_local ACP startup fallback", () => {
it("trusts the Paperclip API URL when network access is allowlisted", async () => {
const paperclipApiUrl = "http://127.0.0.1:4310";
vi.stubEnv("PAPERCLIP_API_URL", paperclipApiUrl);
vi.stubEnv("PAPERCLIP_RUNTIME_API_URL", paperclipApiUrl);
const ctx = buildContext({ networkScope: "allowlist" });
+20 -4
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { resolveViteHmrHost, resolveViteHmrPort } from "../app.ts";
import { resolveViteHmrHost, resolveViteHmrPort, resolveViteHmrProtocol } from "../app.ts";
describe("resolveViteHmrPort", () => {
it("uses serverPort + 10000 when the result stays in range", () => {
@@ -19,13 +19,29 @@ describe("resolveViteHmrPort", () => {
});
describe("resolveViteHmrHost", () => {
it("omits wildcard bind hosts so Vite uses the browser hostname", () => {
it("omits wildcard and loopback bind hosts so Vite uses the browser hostname", () => {
expect(resolveViteHmrHost("0.0.0.0")).toBeUndefined();
expect(resolveViteHmrHost("::")).toBeUndefined();
expect(resolveViteHmrHost("127.0.0.1")).toBeUndefined();
expect(resolveViteHmrHost("::1")).toBeUndefined();
expect(resolveViteHmrHost("localhost")).toBeUndefined();
});
it("keeps concrete bind hosts", () => {
expect(resolveViteHmrHost("127.0.0.1")).toBe("127.0.0.1");
it("keeps externally addressable concrete bind hosts", () => {
expect(resolveViteHmrHost("paperclip-dev")).toBe("paperclip-dev");
});
});
describe("resolveViteHmrProtocol", () => {
it("accepts supported websocket protocols", () => {
expect(resolveViteHmrProtocol(undefined)).toBeUndefined();
expect(resolveViteHmrProtocol("ws")).toBe("ws");
expect(resolveViteHmrProtocol("wss")).toBe("wss");
});
it("rejects unsupported websocket protocols", () => {
expect(() => resolveViteHmrProtocol("https")).toThrow(
"PAPERCLIP_VITE_HMR_PROTOCOL must be ws or wss",
);
});
});
@@ -359,7 +359,6 @@ describeEmbeddedPostgres("accepted plan workspace refresh", () => {
responsibleUserId: "responsible-user",
assigneeAgentId: agentId,
identifier: "PAP-9122",
executionWorkspaceId: sharedExecutionWorkspaceId,
executionWorkspaceSettings: {
mode: "isolated_workspace",
},
@@ -1039,7 +1039,7 @@ describeEmbeddedPostgres("heartbeat workspace branch containment", () => {
});
it.each([
["workspace-runtime fresh worktree reuse", "fresh_realize" as const, null],
["workspace-runtime fresh worktree reuse", "fresh_realize" as const, "source-workspace"],
["workspace-runtime persisted restore", "persisted_restore" as const, "source-workspace"],
])("contains mid-change branch divergence at %s", async (_name, callSite, expectedWorkspaceId) => {
const repoRoot = await createGitRepo();