test(pac): 固化 runtime GitOps verify marker 合同

This commit is contained in:
root
2026-07-14 01:46:35 +02:00
parent f7efcd7d98
commit bd21b3eed5
2 changed files with 4 additions and 1 deletions
File diff suppressed because one or more lines are too long
+3
View File
@@ -53,6 +53,7 @@ test("NC01 PaC artifact keeps the runtime GitOps file contract", async () => {
].join("\n");
const postprocessCommand = "UNIDESK_RUNTIME_GITOPS_OVERLAY_FILE=/etc/unidesk-cicd-runtime-gitops/runtime-gitops-overlay.json node /etc/unidesk-cicd-runtime-gitops/runtime-gitops-postprocess.mjs";
const verifyCommand = "UNIDESK_RUNTIME_GITOPS_OVERLAY_FILE=/etc/unidesk-cicd-runtime-gitops/runtime-gitops-overlay.json node /etc/unidesk-cicd-runtime-gitops/runtime-gitops-verify.mjs";
const runtimeGitopsVerifyMarker = "echo '{\"event\":\"gitops-promote\",\"status\":\"continuing\",\"reason\":\"no-build-no-rollout-plan-gitops-verify\"}' >&2";
const yamlDependencyBootstrapIndex = promoteStep.script.indexOf(yamlDependencyBootstrap);
const postprocessIndex = promoteStep.script.indexOf(postprocessCommand);
const verifyIndex = promoteStep.script.indexOf(verifyCommand);
@@ -60,6 +61,8 @@ test("NC01 PaC artifact keeps the runtime GitOps file contract", async () => {
assert.ok(postprocessIndex > yamlDependencyBootstrapIndex, "runtime GitOps postprocess must run after yaml is linked into the source workspace");
assert.ok(verifyIndex > postprocessIndex, "runtime GitOps verify must run after postprocess with the same yaml dependency bootstrap");
assert.doesNotMatch(promoteStep.script, /UNIDESK_RUNTIME_GITOPS_OVERLAY_B64/u);
assert.doesNotMatch(promoteStep.script, /willRunGitopsPromote/u);
assert.equal(promoteStep.script.split(runtimeGitopsVerifyMarker).length - 1, 1, "runtime GitOps verify marker must stay exact and unique");
});
async function collectGeneratedFiles(root) {