mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 16:01:38 +00:00
* test(docker): prove Compose and package artifacts * test(docker): use bounded container cleanup * test(docker): bound package proof launch * test(qa): keep Docker artifact proofs release-only * test(docker): simplify artifact proof names * test(docker): satisfy identity writer lint
64 lines
1.7 KiB
TypeScript
64 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
formatDockerArtifactIdentityDetails,
|
|
parseDockerArtifactProofOptions,
|
|
} from "./docker-artifact-proof.js";
|
|
|
|
describe("Docker artifact proof producer", () => {
|
|
it("parses the two canonical artifact lanes", () => {
|
|
expect(
|
|
parseDockerArtifactProofOptions([
|
|
"--artifact-base",
|
|
".artifacts/proof",
|
|
"--lane",
|
|
"compose-setup",
|
|
]).lane,
|
|
).toBe("compose-setup");
|
|
expect(
|
|
parseDockerArtifactProofOptions([
|
|
"--artifact-base",
|
|
".artifacts/proof",
|
|
"--lane",
|
|
"docker-package-install",
|
|
]).lane,
|
|
).toBe("docker-package-install");
|
|
});
|
|
|
|
it("rejects non-artifact Docker lanes", () => {
|
|
expect(() =>
|
|
parseDockerArtifactProofOptions([
|
|
"--artifact-base",
|
|
".artifacts/proof",
|
|
"--lane",
|
|
"gateway-network",
|
|
]),
|
|
).toThrow("unsupported Docker artifact proof lane");
|
|
});
|
|
|
|
it("formats package, image, and container identities", () => {
|
|
expect(
|
|
formatDockerArtifactIdentityDetails({
|
|
containers: [
|
|
{
|
|
details: { health: "healthy" },
|
|
id: "container1234567890",
|
|
imageId: "sha256:image",
|
|
name: "gateway",
|
|
role: "gateway",
|
|
state: "running",
|
|
},
|
|
],
|
|
image: { id: "sha256:image", reference: "openclaw:functional", repoDigests: [] },
|
|
package: {
|
|
fileName: "openclaw-current.tgz",
|
|
name: "openclaw",
|
|
sha256: "a".repeat(64),
|
|
sizeBytes: 42,
|
|
version: "2026.7.6",
|
|
},
|
|
scenarioId: "compose-setup",
|
|
}),
|
|
).toContain("containers=gateway=container123");
|
|
});
|
|
});
|