feat: add CI deployment and live progress

This commit is contained in:
2026-09-05 12:09:16 +00:00 Unverified
parent 321f4e807a
commit aa02826dbb
27 changed files with 2711 additions and 180 deletions
+19
View File
@@ -0,0 +1,19 @@
import { expect, spyOn, test } from "bun:test";
import { apiKeyRequest } from "../../command/ci";
test("CI requester supplies an API key without session authentication", async () => {
const fetch = spyOn(globalThis, "fetch").mockResolvedValue(
new Response(JSON.stringify({ ok: true }), { status: 200 }),
);
try {
await apiKeyRequest("ci-secret")("/workspaces/shop/resources/plan", {
headers: { "x-kuber-trust-project": "shop" },
});
const [, init] = fetch.mock.calls[0]!;
const headers = new Headers(init?.headers);
expect(headers.get("authorization")).toBe("Bearer ci-secret");
expect(headers.get("x-kuber-trust-project")).toBe("shop");
} finally {
fetch.mockRestore();
}
});