fix: limit v02 runtime readiness scope
This commit is contained in:
@@ -52,8 +52,14 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
assert.deepEqual(runtimeReady.when, [{ input: "$(tasks.gitops-promote.results.runtime-ready-required)", operator: "in", values: ["true"] }]);
|
||||
const runtimeReadyScript = runtimeReady.taskSpec.steps[0].script;
|
||||
assert.match(runtimeReadyScript, /const pollMs = 1000;/u);
|
||||
assert.match(runtimeReadyScript, /readObservedServiceIds/u);
|
||||
assert.match(runtimeReadyScript, /observedRuntimeItems/u);
|
||||
assert.match(runtimeReadyScript, /observedCount/u);
|
||||
assert.match(runtimeReadyScript, /ids\.has\("hwlab-cloud-api"\)\) ids\.add\("hwlab-deepseek-proxy"\)/u);
|
||||
assert.match(runtimeReadyScript, /status: "timeout", reason: "source-commit-refresh-timeout"/u);
|
||||
assert.match(runtimeReadyScript, /const refresh = await waitForArgoRefresh\(\);\n if \(!refresh\.observed\) return;/u);
|
||||
assert.ok(runtimeReady.workspaces?.some((workspace) => workspace.name === "source" && workspace.workspace === "source"));
|
||||
assert.ok(runtimeReady.taskSpec.workspaces?.some((workspace) => workspace.name === "source"));
|
||||
|
||||
const gitopsPromote = taskByName(pipelineJson, "gitops-promote");
|
||||
assert.ok(gitopsPromote.taskSpec.results.some((result) => result.name === "runtime-ready-required"));
|
||||
@@ -235,6 +241,15 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
|
||||
const content = await readFile(path.join(outDir, "runtime-v02", generatedFile), "utf8");
|
||||
assert.match(content, /"hwlab\.pikastech\.local\/source-commit"/u);
|
||||
}
|
||||
const frpc = JSON.parse(await readFile(path.join(outDir, "runtime-v02", "g14-frpc.yaml"), "utf8"));
|
||||
const frpcDeployment = frpc.items.find((item) => item.kind === "Deployment");
|
||||
assert.ok(frpcDeployment.spec.template.metadata.labels["hwlab.pikastech.local/config-sha256"]);
|
||||
assert.equal(frpcDeployment.spec.template.metadata.labels["hwlab.pikastech.local/source-commit"], undefined);
|
||||
|
||||
const postgres = JSON.parse(await readFile(path.join(outDir, "runtime-v02", "postgres.yaml"), "utf8"));
|
||||
const postgresStatefulSet = postgres.items.find((item) => item.kind === "StatefulSet");
|
||||
assert.ok(postgresStatefulSet.spec.template.metadata.labels["hwlab.pikastech.local/migration-sha256"]);
|
||||
assert.equal(postgresStatefulSet.spec.template.metadata.labels["hwlab.pikastech.local/source-commit"], undefined);
|
||||
|
||||
await assert.rejects(() => readFile(path.join(outDir, "tekton-v02", "control-plane-reconciler.yaml"), "utf8"), { code: "ENOENT" });
|
||||
await assert.rejects(() => readFile(path.join(outDir, "tekton-v02", "poller.yaml"), "utf8"), { code: "ENOENT" });
|
||||
|
||||
Reference in New Issue
Block a user