Repository navigation
The version test asserts the fact instead of a copy of it - #290
Merged
Merged
Conversation
`cargo test --workspace` failed on a clean main: devlaunch-test-support
asserted `CARGO_PKG_VERSION == "0.3.0"` and the 0.3.1 release did not
update the literal.
The literal was the bug, not the missed edit. The crate declares
`version.workspace = true`, which is what makes CARGO_PKG_VERSION the
workspace's version in the first place -- so comparing that variable to a
hardcoded string tests only whether somebody remembered to retype the
string, and the claim in the test's name ("versioned with the workspace")
is a Cargo.toml fact that a literal cannot express. It now reads
Cargo.toml and asserts `version.workspace = true`, which cannot go stale
because there is no second copy of the version to keep in step.
And it failed nothing for a release, which is the other half. The rust
job names the crates it tests one at a time -- deliberately, so each
carries its own timeout -- and this crate was not among them, so the one
command that reaches the test is one only a developer runs. Added as its
own step. What is in there is the fake devpod every integration suite
uses as its whole devpod, so a gap in it is the one way a fake can do
real harm.
cargo test --workspace is green, clippy -D warnings and fmt clean.
Reviewer's GuideThis PR fixes a brittle versioning test in devlaunch-test-support by asserting the workspace-version configuration directly from Cargo.toml, and adds a dedicated CI step so that crate’s tests run in the rust job like the other Rust crates. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #290 +/- ##
=======================================
Coverage 42.98% 42.98%
=======================================
Files 3 3
Lines 221 221
=======================================
Hits 95 95
Misses 126 126 🚀 New features to boost your workflow:
|
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.
main is red on
cargo test --workspaceFound while running the full suite for another change:
devlaunch-test-supportasserted the literal"0.3.0", and #289 (Release 0.3.1) did not update it. My miss.Two things wrong, and the literal is the interesting one
1. The literal cannot express the claim. The crate declares
version.workspace = true— that is what makesCARGO_PKG_VERSIONthe workspace's version. So comparing that variable against a hardcoded string does not test "versioned with the workspace"; it tests whether someone retyped a string. The test now readsCargo.tomland assertsversion.workspace = true, which has no second copy to fall out of step with.Note this is the opposite call from the one in #282, where a literal budget was kept deliberately. There the literal was a ratchet — a real value with no other source of truth, whose failure asks a human to confirm an intended change. Here there is a source of truth one line away in
Cargo.toml, and the literal only duplicated it.2. It failed nothing for an entire release. The
rustjob names crates one at a time — on purpose, so each gets its own timeout — anddevlaunch-test-supportwas not among them:So the only command that reaches this test is
cargo test --workspace, which only a developer runs — and CLAUDE.md documents exactly that command. Added as its own CI step. What lives in that crate is the fake devpod every integration suite uses as its whole devpod, so a fidelity gap there is the one way a fake can do real harm.The
gatejob already coversrust, so it needs no change.Checks
cargo test --locked --workspace— green, all cratescargo clippy --locked --all-targets -- -D warnings— cleancargo fmt --check— clean🤖 Generated with Claude Code
Summary by Sourcery
Ensure the test-support crate verifies workspace version inheritance and is covered by CI.
Bug Fixes:
CI:
Tests: