17 lines
1.3 KiB
TypeScript
17 lines
1.3 KiB
TypeScript
import { expect, test } from "bun:test";
|
|
|
|
import { hwlabRuntimeLaneSpecForNode } from "./hwlab-node-lanes";
|
|
import { releaseAMonitorManifests } from "./hwlab-node-web-probe-monitor";
|
|
|
|
test("Release A central monitor renders internal service, deployment and read-only PVC migration job", () => {
|
|
const manifests = releaseAMonitorManifests(hwlabRuntimeLaneSpecForNode("v03", "NC01"));
|
|
const service = manifests.find((item) => item.kind === "Service") as any;
|
|
const deployment = manifests.find((item) => item.kind === "Deployment") as any;
|
|
const job = manifests.find((item) => item.kind === "Job") as any;
|
|
expect(service.spec.type).toBe("ClusterIP");
|
|
expect(deployment.spec.template.spec.containers[0].env).toEqual(expect.arrayContaining([expect.objectContaining({ name: "DATABASE_URL", valueFrom: { secretKeyRef: { name: "hwlab-web-probe-monitor-db", key: "DATABASE_URL" } } })]));
|
|
expect(job.spec.template.spec.containers[0].args).toContain("plan");
|
|
expect(job.spec.template.spec.containers[0].volumeMounts).toEqual([{ name: "legacy-sqlite", mountPath: "/var/lib/web-probe-sentinel-nc01", readOnly: true }]);
|
|
expect(job.spec.template.spec.volumes).toEqual([{ name: "legacy-sqlite", persistentVolumeClaim: { claimName: "hwlab-web-probe-sentinel-nc01-state", readOnly: true } }]);
|
|
});
|