test: keep the real-changelog release check passing right after a release - #152
Merged
Merged
Conversation
…ease test_the_repository_changelog_can_be_released promotes the real CHANGELOG.md. Right after a release its `## [Unreleased]` section is empty, and promote() rightly refuses an empty section, so the test failed on master from the 0.3.7 release until the next changelog entry. That turned the Coverage Badge and Test runs red on master and on pull requests without a changelog entry (#151). When the section is empty, the test now gives it a placeholder entry before promoting, so the rest of the file (heading order and the compare links) is still checked. A non-empty section is left as it is.
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.
What
tests/test_changelog_release.py::test_the_repository_changelog_can_be_releasedrunspromote()on the realCHANGELOG.md. Right after a release,## [Unreleased]is empty, andpromote()correctly refuses an empty section (`## [Unreleased]` is empty). So the test fails from the moment a release is cut until someone adds the next changelog entry. Since 0.3.7, that has turned these checks red:#150 passed only because it adds entries.
The test already reads the latest version from the file so that it "keeps passing after every release", but it never handled the empty section. It now does: when
## [Unreleased]is empty, the test gives it a placeholder entry before promoting. The rest of the checks still run, including heading order, the new compare link and that every heading has a link definition. A non-empty section is left alone.Verified
CACHEX_REQUIRE_LIVE_SERVERS=1): 761 passed, coverage 100%.[Unreleased]and a populated one.