fix: keep the fixture evidence test about preservation, and stop scanning worktrees

The release-evidence test asserted that every artifact a candidate is assembled
from survives the copy, which quietly assumed the checkout had already run the
release chain. It holds in this repository and fails in a product repository
that has not, where `artifacts/performance/bundle.json` simply does not exist
yet — a fact about the checkout, not about the copier. It now asserts that
whatever release evidence is present is preserved, and that at least one thing
was, so it cannot pass by finding nothing to check.

Vitest also walked `.worktrees/`. A git worktree inside the repository is a
different checkout of a different branch; running its tests against this
checkout's config produces failures that belong to neither and cost real time
to attribute.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
DongHyeonka
2026-08-15 21:30:54 +09:00
co-authored by Claude Opus 5
parent 9ca5c3f668
commit 5434760ddf
2 changed files with 20 additions and 3 deletions
+16 -3
View File
@@ -103,13 +103,26 @@ describe("release evidence fixture copy", () => {
const root = await mkdtemp(nodePath.join(tmpdir(), "release-evidence-")); const root = await mkdtemp(nodePath.join(tmpdir(), "release-evidence-"));
await copyReleaseEvidenceTree(process.cwd(), root); await copyReleaseEvidenceTree(process.cwd(), root);
// Every artifact a candidate archive is assembled from has to survive; a // Every release artifact that exists here has to survive the copy; a
// fixture missing one of these cannot build a candidate at all, and every // fixture missing one cannot build a candidate at all, and every provider
// provider suite then fails while constructing its own fixture. // 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) { for (const evidence of RELEASE_CANDIDATE_EVIDENCE_PATHS) {
if (!evidence.startsWith("artifacts/")) continue; if (!evidence.startsWith("artifacts/")) continue;
try {
await access(evidence);
} catch {
continue;
}
await expect(access(nodePath.join(root, evidence)), evidence).resolves.toBeUndefined(); 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 // 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, // are tens of megabytes of traces and coverage HTML. They still exist,
// because the repository inventory expects the directories. // because the repository inventory expects the directories.
+4
View File
@@ -11,6 +11,10 @@ export default defineConfig({
exclude: [ exclude: [
...configDefaults.exclude, ...configDefaults.exclude,
".tmp/**", ".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/**", "tests/fixtures/v8-coverage-counter-semantics/**",
], ],
coverage: { coverage: {