test: bootstrap release artifacts via Vitest globalSetup (#4)#51
Merged
Conversation
tests/guardbench.test.js holds ~15 release/publication integration tests that
read the canonical artifact outputs produced by `npm run test:artifacts`
(GuardBench results, external-adapter evidence, arXiv source, paper submission
bundle). A bare `vitest run` without the heavy `pretest` chain left them red.
Add a Vitest globalSetup that generates exactly those artifacts on demand,
deterministically, while deliberately skipping the two environment-fragile
steps from `test:artifacts`:
- `paper:sync`, which rewrites tracked docs/paper/*.md with machine-local
benchmark numbers; and
- the real LaTeX compile, which embeds a machine-local absolute path in the
PDF (it forces a deterministic pending compile report instead).
Both remain covered by `npm run release:gate:paper`. A bare `vitest run` from a
clean checkout is now fully green (785 passed, 0 failed).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Decouples the release/publication integration tests in
tests/guardbench.test.js(~15 tests) from the heavypretest→test:artifactschain. A barevitest runnow bootstraps the canonical artifacts it needs via a Vitest globalSetup.What it generates
GuardBench results + conformance card + submission bundle + leaderboard + adapter self-test, external-adapter dry-run + evidence, behavioral-benchmark summary, arXiv source, a deterministic pending compile report, and the paper submission bundle.
What it deliberately skips (both still covered by
release:gate:paper)paper:sync— rewrites trackeddocs/paper/*.mdwith machine-local benchmark numbers.Result
vitest runfrom a clean checkout (nopretest): 785 passed, 0 failed. Idempotent on re-run (artifacts present → setup skips heavy generation). lint / format:check / typecheck all clean.🤖 Generated with Claude Code