Skip to content

test: keep the real-changelog release check passing right after a release - #152

Merged
allen0099 merged 1 commit into
masterfrom
test/changelog-empty-unreleased
Sep 25, 2026
Merged

allen0099 merged 1 commit into
masterfrom
test/changelog-empty-unreleased

Conversation

@allen0099

Copy link
Copy Markdown
Owner

What

tests/test_changelog_release.py::test_the_repository_changelog_can_be_released runs promote() on the real CHANGELOG.md. Right after a release, ## [Unreleased] is empty, and promote() 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

  • Without the fix, the test fails on current master. With it, the test passes.
  • Full suite against live Redis and Memcached (CACHEX_REQUIRE_LIVE_SERVERS=1): 761 passed, coverage 100%.
  • The regex matches only an empty section. I checked it against an empty [Unreleased] and a populated one.

…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.
@allen0099
allen0099 merged commit 0e896dc into master Sep 25, 2026
10 checks passed
@allen0099
allen0099 deleted the test/changelog-empty-unreleased branch September 26, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant