Skip to content

test: stop hardcoding the version literal in tests; enforce lockstep (#29) - #37

Merged
submtd merged 1 commit into
mainfrom
feature/issue-29-version-literals
Jul 23, 2026
Merged

test: stop hardcoding the version literal in tests; enforce lockstep (#29)#37
submtd merged 1 commit into
mainfrom
feature/issue-29-version-literals

Conversation

@submtd

@submtd submtd commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Closes #29.

The problem

Nine test files hardcoded the version string (assert bosun.__version__ == "0.7.0"). Every release turned the suite red — 15 failures on the way to 0.6.0 — until all nine were hand-edited. I just re-paid that exact tax cutting 0.7.0. And the check is worthless: it fails on every legitimate bump and passes on every wrong-but-consistent one.

The change

  • Six per-plugin test_smoke.py: version assertions now check the property__version__ exists, is a string, matches ^\d+\.\d+\.\d+$ — naming no value. keel's VERSION = "..." constant is gone.
  • Three test_stacks.py: the test_<plugin>_version functions were exact duplicates of the smoke check — deleted.
  • tests/test_marketplace.py: gains test_all_plugins_report_the_same_version — enforces lockstep (all six equal), the guarantee the nine literals were groping toward, without naming a version. Nothing enforced lockstep before this.

Net effect

A release now edits only the twelve files that genuinely carry the version (6 plugin.json + 6 __init__.py). Zero test edits.

Verification (both run, not committed)

  • Release-proof: bumped all twelve carriers to a fake 9.9.9 → suite stayed green (1404) with zero test edits.
  • Teeth: desynced one plugin's version → the lockstep test and the existing agreement test both went red.

Suite: 1406 → 1404 (−3 deleted duplicate version tests, +1 lockstep test). Test-only change; changelog notes it under Changed since lockstep enforcement is a stated suite property.

🤖 Generated with Claude Code

…29)

The per-plugin smoke tests and three stacks tests hardcoded the version string
(`assert x.__version__ == "0.7.0"`), so every release turned the suite red until
all nine were hand-edited -- a check that fails on every legitimate bump and
passes on every wrong-but-consistent one. They now assert __version__ is
well-formed semver, naming no value. The three redundant stacks version tests
are deleted (smoke covers the property). tests/test_marketplace.py gains
test_all_plugins_report_the_same_version, enforcing lockstep -- the guarantee
the nine literals were reaching for -- without naming a version.

Verified: bumping all twelve genuine carriers to a fake version keeps the suite
green with zero test edits; desyncing one plugin turns the lockstep and
agreement tests red.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@submtd submtd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against keel's rubric. Ready to land.

Correctness. Every == "0.7.0" in the six smoke tests and three stacks tests is gone; smoke now checks the semver property, naming no value, and keel's VERSION constant is removed. The three stacks version tests were exact duplicates of the smoke check and are deleted, not weakened.

The new guarantee has teeth. test_all_plugins_report_the_same_version enforces lockstep — which nothing did before. Verified both directions: desyncing one plugin's version turns it and the existing agreement test red; bumping all twelve carriers consistently to a fake version keeps the suite green with zero test edits.

Scope. Test-only plus a changelog Changed note. Suite 1406 → 1404 (−3 duplicate tests, +1 lockstep). Good to land.

@submtd
submtd merged commit 1a0a799 into main Jul 23, 2026
4 checks passed
@submtd
submtd deleted the feature/issue-29-version-literals branch July 23, 2026 00:50
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.

release: bumping a version requires hand-editing 9 test files that hardcode the version literal

1 participant