Merge pull request #2535 from pikasTech/chore/pac-runtime-gitops-marker-artifact
Pipelines as Code CI / hwlab-nc01-v03-ci-poll- Success

test(pac): 固化 runtime GitOps verify marker 合同
This commit is contained in:
Lyon
2026-07-14 08:02:17 +08:00
committed by GitHub
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) {