fix: enable v02 env reuse code-only rollout
This commit is contained in:
@@ -46,7 +46,7 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
assert.match(pipeline, /node scripts\/run-bun\.mjs test cmd\/hwlab-codex-api-responses-forwarder\/main\.test\.ts/u);
|
||||
assert.doesNotMatch(pipeline, /cmd\/hwlab-codex-api-responses-forwarder\/main\.mjs/u);
|
||||
assert.match(pipeline, /process\.exitCode = 1/u);
|
||||
assert.match(pipeline, /item\.spec\?\.template\?\.metadata\?\.labels\?\.\[\\"hwlab\.pikastech\.local\/source-commit\\"\]/u);
|
||||
assert.match(pipeline, /item\.metadata\?\.labels\?\.\[\\"hwlab\.pikastech\.local\/source-commit\\"\]/u);
|
||||
|
||||
const runtimeReady = taskByName(pipelineJson, "runtime-ready");
|
||||
const runtimeReadyScript = runtimeReady.taskSpec.steps[0].script;
|
||||
@@ -113,8 +113,16 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
const task = taskByName(pipelineJson, `build-${serviceId}`);
|
||||
const expectedRunAfter = index === 0 ? ["plan-artifacts"] : [`build-${retainedServiceIds[index - 1]}`];
|
||||
assert.deepEqual(task.runAfter, expectedRunAfter);
|
||||
assert.deepEqual(task.when, [{ input: `$(tasks.plan-artifacts.results.affected-${serviceId})`, operator: "in", values: ["true"] }]);
|
||||
}
|
||||
|
||||
const collectArtifacts = taskByName(pipelineJson, "collect-artifacts");
|
||||
const collectScript = collectArtifacts.taskSpec.steps[0].script;
|
||||
assert.match(collectScript, /--external-service-report-dir \/workspace\/source\/service-results/u);
|
||||
assert.doesNotMatch(JSON.stringify(collectArtifacts), /tasks\.build-hwlab-device-pod\.results/u);
|
||||
const devicePodBuildScript = taskByName(pipelineJson, "build-hwlab-device-pod").taskSpec.steps.find((step) => step.name === "publish")?.script ?? "";
|
||||
assert.match(devicePodBuildScript, /--report "\/workspace\/source\/service-results\/\$\(params\.service-id\)\.json"/u);
|
||||
|
||||
const workloads = await readFile(path.join(outDir, "runtime-v02", "workloads.yaml"), "utf8");
|
||||
const workloadsJson = JSON.parse(workloads);
|
||||
const services = await readFile(path.join(outDir, "runtime-v02", "services.yaml"), "utf8");
|
||||
@@ -140,10 +148,8 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
assert.equal(agentWorkerEnv.some((entry) => entry.name === "HWLAB_BOOT_COMMIT"), false, "agent-worker must not be switched to env reuse by device-pod work");
|
||||
const workloadTemplates = workloadsJson.items.filter((item) => item.spec?.template?.metadata?.labels?.["hwlab.pikastech.local/source-commit"]);
|
||||
assert.ok(workloadTemplates.length > 0, "expected rendered pod-template source labels");
|
||||
for (const item of workloadTemplates) {
|
||||
assert.equal(item.spec.template.metadata.labels["hwlab.pikastech.local/source-commit"], sourceRevision);
|
||||
assert.equal(item.spec.template.metadata.annotations["hwlab.pikastech.local/source-commit"], sourceRevision);
|
||||
}
|
||||
assert.equal(devicePod.spec.template.metadata.labels["hwlab.pikastech.local/source-commit"], sourceRevision);
|
||||
assert.equal(devicePod.spec.template.metadata.annotations["hwlab.pikastech.local/source-commit"], sourceRevision);
|
||||
assert.ok(workloadTemplates.some((item) => item.spec.template.metadata.labels["hwlab.pikastech.local/artifact-source-commit"]), "expected artifact source labels on pod templates");
|
||||
assert.doesNotMatch(workloads, /HWLAB_GATEWAY_SIMU_URL/u);
|
||||
assert.doesNotMatch(workloads, /HWLAB_BOX_SIMU_URL/u);
|
||||
@@ -152,7 +158,8 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
assert.doesNotMatch(workloads, /HWLAB_TUNNEL_CLIENT_URL/u);
|
||||
|
||||
assert.doesNotMatch(pipeline, /hwlab-gateway-simu-status/u);
|
||||
assert.match(pipeline, /hwlab-cloud-api-status/u);
|
||||
assert.doesNotMatch(pipeline, /tasks\.build-hwlab-cloud-api\.results/u);
|
||||
assert.match(pipeline, /--external-service-report-dir \/workspace\/source\/service-results/u);
|
||||
|
||||
const application = await readFile(path.join(outDir, "argocd", "application-v02.yaml"), "utf8");
|
||||
assert.match(application, /"prune": true/u);
|
||||
|
||||
Reference in New Issue
Block a user