@@ -795,13 +795,55 @@ describe("ci workflow guards", () => {
|
795 | 795 | |
796 | 796 | it("keeps workflow guards in fast CI-routing checks", () => { |
797 | 797 | const workflow = readCiWorkflow(); |
| 798 | +const preflightStep = workflow.jobs.preflight.steps.find( |
| 799 | +(step) => step.name === "Build CI manifest", |
| 800 | +); |
| 801 | +const taxonomy = parse(readFileSync("taxonomy.yaml", "utf8")) as { |
| 802 | +profiles: Array<{ id: string; categoryIds: string[] }>; |
| 803 | +}; |
| 804 | +const smokeProfile = taxonomy.profiles.find((profile) => profile.id === "smoke-ci"); |
| 805 | +if (!smokeProfile) { |
| 806 | +throw new Error("taxonomy.yaml is missing the smoke-ci profile"); |
| 807 | +} |
798 | 808 | const fastCoreJob = workflow.jobs["checks-fast-core"]; |
799 | 809 | const runStep = fastCoreJob.steps.find( |
800 | 810 | (step) => step.name === "Run ${{ matrix.task }} (${{ matrix.runtime }})", |
801 | 811 | ); |
| 812 | +const uploadStep = fastCoreJob.steps.find( |
| 813 | +(step) => step.name === "Upload QA smoke profile evidence", |
| 814 | +); |
| 815 | + |
| 816 | +const ciWorkflowText = readFileSync(".github/workflows/ci.yml", "utf8"); |
802 | 817 | |
| 818 | +expect(preflightStep.run).not.toContain("qa-smoke-profile"); |
| 819 | +expect(preflightStep.run).not.toContain("qa_category"); |
| 820 | +expect(smokeProfile.categoryIds).toHaveLength(30); |
| 821 | +for (const categoryId of smokeProfile.categoryIds) { |
| 822 | +expect(ciWorkflowText).not.toContain(`"${categoryId}"`); |
| 823 | +} |
| 824 | +expect(runStep.run).toContain("bundled-protocol)"); |
| 825 | +expect(runStep.run).toContain("qa-smoke-ci)"); |
803 | 826 | expect(runStep.run).toContain("contracts-plugins-ci-routing)"); |
804 | 827 | expect(runStep.run).toContain("ci-routing)"); |
| 828 | +expect(ciWorkflowText).toContain( |
| 829 | +'{ check_name: "QA Smoke CI", runtime: "node", task: "qa-smoke-ci" }', |
| 830 | +); |
| 831 | +expect(runStep.run).toContain("--qa-profile smoke-ci"); |
| 832 | +expect(runStep.run).toContain("--concurrency 8"); |
| 833 | +expect(runStep.run).not.toContain("--category"); |
| 834 | +expect(runStep.run).not.toContain("--allow-failures"); |
| 835 | +expect(runStep.run).toContain("qa_exit_code=0"); |
| 836 | +expect(runStep.run).toContain('exit "$qa_exit_code"'); |
| 837 | +expect(runStep.run).toContain("scripts/build-all.mjs qaRuntime"); |
| 838 | +expect(runStep.run).not.toContain("OPENAI_API_KEY"); |
| 839 | +expect(runStep.run).toMatch( |
| 840 | +/bundled-protocol\)\s+pnpm test:bundled\s+pnpm protocol:check\s+;;\s+qa-smoke-ci\)/, |
| 841 | +); |
| 842 | +expect(uploadStep.if).toBe("always() && matrix.task == 'qa-smoke-ci'"); |
| 843 | +expect(uploadStep.with).toMatchObject({ |
| 844 | +path: ".artifacts/qa-e2e/smoke-ci-profile/", |
| 845 | +"if-no-files-found": "warn", |
| 846 | +}); |
805 | 847 | expect(runStep.run.match(/test\/scripts\/ci-workflow-guards\.test\.ts/g)?.length).toBe(2); |
806 | 848 | }); |
807 | 849 | |
|