diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index 1366ef1..0be5ac3 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -103,13 +103,26 @@ describe("release evidence fixture copy", () => { const root = await mkdtemp(nodePath.join(tmpdir(), "release-evidence-")); await copyReleaseEvidenceTree(process.cwd(), root); - // Every artifact a candidate archive is assembled from has to survive; a - // fixture missing one of these cannot build a candidate at all, and every - // provider suite then fails while constructing its own fixture. + // Every release artifact that exists here has to survive the copy; a + // fixture missing one cannot build a candidate at all, and every provider + // suite then fails while constructing its own fixture. + // + // Which ones exist depends on what this checkout has generated — a product + // repository that has not run the release chain has fewer than the template + // does — so the subject is preservation, not the presence of a full chain. + // Requiring at least one keeps that from quietly asserting nothing. + let preserved = 0; for (const evidence of RELEASE_CANDIDATE_EVIDENCE_PATHS) { if (!evidence.startsWith("artifacts/")) continue; + try { + await access(evidence); + } catch { + continue; + } await expect(access(nodePath.join(root, evidence)), evidence).resolves.toBeUndefined(); + preserved += 1; } + expect(preserved).toBeGreaterThan(0); // The regenerated trees are why this is a filter and not a plain copy: they // are tens of megabytes of traces and coverage HTML. They still exist, // because the repository inventory expects the directories. diff --git a/vitest.config.ts b/vitest.config.ts index 406932a..5358cb1 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -11,6 +11,10 @@ export default defineConfig({ exclude: [ ...configDefaults.exclude, ".tmp/**", + // A git worktree inside the repository is a different checkout of a + // different branch. Running its tests against this checkout's config + // reports failures that belong to neither. + ".worktrees/**", "tests/fixtures/v8-coverage-counter-semantics/**", ], coverage: {