fix(test): unblock Coverage Validation; release 1.20.3#307
Conversation
…se 1.20.3 The `test_changelog_default_shows_current_version` test exited 1 because the default `rxiv changelog` path looks up `__version__`, but the mocked `sample_changelog` fixture topped out at v1.20.1 while `__version__` had moved to 1.20.2. This was the sole cause of the `Coverage Validation` CI check failing, marking every PR UNSTABLE. The test now injects an entry for the current `__version__` into the mocked content instead of relying on a hard-coded fixture version, so it stays green across future version bumps without disturbing the version-counting tests that depend on the shared fixture's ordering. Bumps version to 1.20.3 and adds the matching CHANGELOG entry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
95ff0b1 to
69e994e
Compare
Code Review — PR #307:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a pre-existing CI failure in the Coverage Validation check by making the rxiv changelog default-path test resilient to future version bumps, and it performs the 1.20.3 release bump (code + changelog).
Changes:
- Update
test_changelog_default_shows_current_versionto inject an entry for the runtime__version__into the mocked changelog content. - Bump package version to
1.20.3. - Add a
1.20.3entry toCHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/cli/test_changelog_command.py |
Makes the default changelog CLI test independent of hard-coded fixture versions by injecting the current __version__. |
src/rxiv_maker/__version__.py |
Bumps the package version to 1.20.3 (used by the CLI default behavior). |
CHANGELOG.md |
Adds release notes for 1.20.3 describing the CI/test fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review: fix(test): unblock Coverage Validation; release 1.20.3OverviewThis PR fixes a genuine test brittleness: test_changelog_default_shows_current_version hard-coded the sample fixture up to v1.20.1, causing it to fail whenever version advanced past that. The fix injects a dynamic entry for the current version into the mocked content at test time, decoupling the test from the fixture's version ceiling. Code QualityThe approach is correct and well-reasoned. Three things to flag: 1. Stale inline comment in sample_changelog fixture (minor)The comment at line 28 of tests/cli/test_changelog_command.py predates this fix and is now misleading - the fixture no longer includes the current version; that job moved to the individual test. It should be removed or updated (e.g. to say the fixture is static and current-version injection is handled per-test). 2. Hard-coded date in the injected entry (cosmetic)The date 2026-06-09 is a snapshot of today. The parser extracts it and stores it on ChangelogEntry.date, but none of the assertions in this test touch .date, so it does not affect correctness. Still, future readers may wonder why the date is pinned here. A comment noting that the date is arbitrary and not asserted on would prevent confusion. 3. CHANGELOG PR reference appears inconsistent (needs verification)The PR diff shows the new CHANGELOG entry ending with (#307), but the file currently on disk ends with (#306). This may be a merge-artifact in the CI checkout, or it may indicate the entry was edited after the diff was taken. Please verify the reference is correct before merging. Correctness
Test CoverageThe fix is surgical - it touches only the one test that was broken and preserves the shared fixture's exact ordering, so the --recent / --since count-based tests are unaffected. No new tests are needed; the existing 19-pass result confirms coverage. SummarySolid, minimal fix. One stale comment to clean up and one potential CHANGELOG reference to double-check, but neither is a blocker. The dynamic injection approach is the right long-term solution to this class of version-drift failures. |
Summary
Fixes the pre-existing
Coverage ValidationCI failure that marked every PR UNSTABLE, and bumps to 1.20.3.tests/cli/test_changelog_command.py::test_changelog_default_shows_current_versionwas exiting 1 because the defaultrxiv changelogpath looks up__version__, but the mockedsample_changelogfixture topped out atv1.20.1while__version__had moved to1.20.2.parse_version_entryreturnedNone→sys.exit(1)→assert 1 == 0. This was the sole reasonCoverage Validationwas red (the coverage threshold itself passes at ~43.5% ≥ 40%).Fix
The default test now injects an entry for the current
__version__into the mocked content instead of relying on a hard-coded fixture version. This keeps it green across future version bumps, and avoids perturbing the version-counting tests (--since,--recent) that depend on the shared fixture's exact ordering.Release
src/rxiv_maker/__version__.pyto1.20.3## [1.20.3]CHANGELOG entryVerification
pytest tests/cli/test_changelog_command.py→ 19 passed, 1 skipped (pre-existing env skip) on Python 3.11🤖 Generated with Claude Code