test(removal): 제거 사본에서도 남는 명령으로 CI 계약 정리를 시험한다
removal-fixture.test.ts는 선택 recipe 제거 사본 안에서도 돈다. 정리 대상으로 고른 test:recipes가 그 사본에는 이미 없어 FE-GATE-020이 실패했다. 어느 제거 사본에도 남는 test:integration과 그 산출물로 바꿨다.
This commit is contained in:
@@ -75,19 +75,21 @@ async function copyCiContract(prefix: string): Promise<string> {
|
||||
it("prunes removed command and evidence references and re-baselines the contract", async () => {
|
||||
const root = await copyCiContract("removal-fixture-contract-");
|
||||
|
||||
// A command with evidence of its own, as a removed sample's tests had.
|
||||
// A command with evidence of its own, as a removed sample's tests had. Not
|
||||
// one a removal drill deletes: this test also runs inside those copies
|
||||
// (test:recipes is gone in the optional-recipe removal copy).
|
||||
await pruneRemovalFixtureCiContract({
|
||||
root,
|
||||
removedScripts: new Set(["test:recipes"]),
|
||||
removedEvidencePathFragments: ["optional-recipes.xml"],
|
||||
removedScripts: new Set(["test:integration"]),
|
||||
removedEvidencePathFragments: ["integration.xml"],
|
||||
});
|
||||
|
||||
const contract = await loadCiGateContract(root);
|
||||
expect(contract.commands.some(({ script }) => script === "test:recipes")).toBe(false);
|
||||
expect(contract.artifacts.some(({ path }) => path.includes("optional-recipes.xml"))).toBe(false);
|
||||
expect(contract.gates.some(({ commandIds }) => commandIds.includes("test-recipes"))).toBe(false);
|
||||
expect(contract.commands.some(({ script }) => script === "test:integration")).toBe(false);
|
||||
expect(contract.artifacts.some(({ path }) => path.includes("integration.xml"))).toBe(false);
|
||||
expect(contract.gates.some(({ commandIds }) => commandIds.includes("test-integration"))).toBe(false);
|
||||
expect(contract.gates.some(({ evidenceArtifactIds }) =>
|
||||
evidenceArtifactIds.includes("artifact-artifacts-tests-optional-recipes-xml")
|
||||
evidenceArtifactIds.includes("artifact-artifacts-tests-integration-xml")
|
||||
)).toBe(false);
|
||||
const baseline = JSON.parse(
|
||||
await readFile(path.join(root, "config/ci/contract-baseline.json"), "utf8"),
|
||||
|
||||
Reference in New Issue
Block a user