Cover the bundle-backed docs render path - #168
Merged
Merged
Conversation
The publish failed on "generated results.md does not begin with a heading" because nothing exercised the path that renders a bundle's pages. Local checks run the no-bundle placeholder, which shares almost no code with it, so the manual publish was the only integration test and the bug reached production. Add a suite over the rendering helpers. They are pure and read the page body from disk, so a realistic generated page drives them without a checksum-valid bundle; bundle validation belongs to the publish and is not re-tested. The fixtures are shaped after what the Rust generator actually emits: the provenance comment first, an H1 in results.md and none in case-comparison.md, and links relative to the bundle root. Covered: frontmatter leads, the generated H1 is demoted so Starlight does not render two titles, the generator preamble survives, bundle-relative links become release-absolute while site-relative and anchor links do not, the sibling prefix differs between a page at /results/ and one a segment deeper, and a page without the preamble is refused. Reintroducing the original guard turns 9 of these red, so they hold the behaviour that was missing rather than restating the implementation. Also run Python tests on pull requests. These suites ran nowhere: only the reference-environment, freeze, and reproduction-contract workflows invoked unittest, each naming a single file, so tests/test_generate_docs_evidence.py had never run in CI at all. Discovery is used rather than another named file, so the next suite is not added and silently never run. Testing: discovery finds 39 tests across the five suites and they pass. Co-Authored-By: Claude Opus 5 <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.
Closes #156.
The publish failed on
generated results.md does not begin with a headingbecause nothing exercised the code that renders a bundle's pages. Local checks
(
results:check,astro check,links:check) all run the no-bundleplaceholder, which shares almost no code with the path that matters, so the
manual publish was the only integration test.
The suite
The rendering helpers are pure and read the page body from disk, so a realistic
generated page drives them without a checksum-valid bundle. Bundle validation
belongs to the publish itself and is deliberately not re-tested here — that was
the awkward part flagged in the issue, and testing the helpers directly is the
way around it.
Fixtures are shaped after what
generate-resultsactually emits: provenancecomment first, an H1 in
results.mdand none incase-comparison.md, and](../…)links relative to the bundle root.Covered:
anchor links are left alone
index.mdgetsevidence/andcase-comparison.mdgets../evidence/These have teeth. Reintroducing the original
startswith("#")guard turns9 of the 14 red; restoring it turns them green. They hold the missing
behaviour rather than restating the implementation.
Python tests now run on pull requests
Following the issue's second half:
test.ymlran no Python at all. Only thereference-environment, freeze, and reproduction-contract workflows invoked
unittest, and each names a single file — so
tests/test_generate_docs_evidence.pyhad never run in CI. This uses discovery rather than another named file, so
the next suite added is not silently skipped.
Discovery finds 39 tests across the five suites; all pass.
🤖 Generated with Claude Code