fix: skip v02 runtime wait on no-op promotion

This commit is contained in:
Codex
2026-05-30 09:41:31 +08:00
parent 77b4e8afa2
commit e2a29f9fd8
2 changed files with 112 additions and 2 deletions
+6
View File
@@ -49,13 +49,19 @@ test("v02 render follows TypeScript runtime checks and does not self-patch boots
assert.match(pipeline, /item\.metadata\?\.labels\?\.\[\\"hwlab\.pikastech\.local\/source-commit\\"\]/u);
const runtimeReady = taskByName(pipelineJson, "runtime-ready");
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, /status: "timeout", reason: "source-commit-refresh-timeout"/u);
assert.match(runtimeReadyScript, /const refresh = await waitForArgoRefresh\(\);\n if \(!refresh\.observed\) return;/u);
const gitopsPromote = taskByName(pipelineJson, "gitops-promote");
assert.ok(gitopsPromote.taskSpec.results.some((result) => result.name === "runtime-ready-required"));
const gitopsPromoteScript = gitopsPromote.taskSpec.steps[0].script;
assert.match(gitopsPromoteScript, /printf 'true' > \/tekton\/results\/runtime-ready-required/u);
assert.match(gitopsPromoteScript, /runtime-identity-only/u);
assert.match(gitopsPromoteScript, /skipped-runtime-unchanged/u);
assert.match(gitopsPromoteScript, /printf 'false' > \/tekton\/results\/runtime-ready-required/u);
assert.match(gitopsPromoteScript, /argo_hard_refresh_v02\(\) \{/u);
assert.match(gitopsPromoteScript, /argocd\.argoproj\.io\/refresh": "hard"/u);
assert.match(gitopsPromoteScript, /applications\/" \+ encodeURIComponent\(application\) \+ "\?fieldManager=hwlab-v02-gitops-promote/u);