test(FN-2358): harden clean-worktree CI verification tests
- Assert contributing docs explicitly state that pnpm test must run without prior build outputs - Add CI workflow test coverage to keep docs and verify:workspace ordering aligned - Expand Vitest workspace alias assertions to include @fusion/test-utils and src-only replacements - Validate real symbol imports from workspace packages when dist directories are absent
This commit is contained in:
@@ -23,12 +23,14 @@ describe("CI workflow (.github/workflows/ci.yml)", () => {
|
||||
let workflow: any;
|
||||
let content: string;
|
||||
let ciSteps: any[];
|
||||
let contributingContent: string;
|
||||
|
||||
beforeAll(() => {
|
||||
const result = loadWorkflow("ci.yml");
|
||||
workflow = result.parsed;
|
||||
content = result.content;
|
||||
ciSteps = workflow.jobs?.ci?.steps ?? [];
|
||||
contributingContent = readFileSync(join(workspaceRoot, "docs", "contributing.md"), "utf-8");
|
||||
});
|
||||
|
||||
const findStepByRun = (runSnippet: string) => ciSteps.find((step) => typeof step.run === "string" && step.run.includes(runSnippet));
|
||||
@@ -74,6 +76,14 @@ describe("CI workflow (.github/workflows/ci.yml)", () => {
|
||||
expect(buildExeIdx).toBeGreaterThan(verifyIdx);
|
||||
});
|
||||
|
||||
it("keeps contributing docs aligned with the clean-worktree verification contract", () => {
|
||||
expect(contributingContent).toContain("pnpm test` must be runnable in a clean worktree without requiring a prior `pnpm build`.");
|
||||
expect(contributingContent).toContain("`pnpm verify:workspace` is the canonical pre-merge gate");
|
||||
expect(contributingContent).toContain("1. `pnpm lint`");
|
||||
expect(contributingContent).toContain("2. `pnpm test`");
|
||||
expect(contributingContent).toContain("3. `pnpm build`");
|
||||
});
|
||||
|
||||
it("includes binary build step", () => {
|
||||
expect(content).toContain("build:exe");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user