diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd5a98f0..56e87533 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,6 +171,13 @@ jobs: - name: Test devlaunch-core working-directory: rust run: timeout 600 cargo test --locked -p devlaunch-core -- --test-threads=1 --nocapture + # The steps here name one crate each, which is what lets each carry its own + # timeout -- and what silently left this one uncovered. Its tests are the + # fake devpod the integration suites use as their whole devpod, so a + # fidelity gap in it is the one way a fake can do real harm. + - name: Test devlaunch-test-support + working-directory: rust + run: timeout 300 cargo test --locked -p devlaunch-test-support -- --test-threads=1 --nocapture - name: Test aid (bins + rewrite) working-directory: rust run: timeout 300 cargo test --locked -p aid --bins --test rewrite -- --test-threads=1 --nocapture diff --git a/rust/devlaunch-test-support/src/lib.rs b/rust/devlaunch-test-support/src/lib.rs index c472684d..4efaa829 100644 --- a/rust/devlaunch-test-support/src/lib.rs +++ b/rust/devlaunch-test-support/src/lib.rs @@ -30,8 +30,25 @@ pub use response::Response; #[cfg(test)] mod tests { + /// This crate carries the workspace's version rather than one of its own. + /// + /// Asserted against `Cargo.toml` rather than against a literal. A literal is + /// the same claim written in a way that has to be hand-edited every release + /// and fails nothing until someone runs the one command that reaches it: + /// `version.workspace = true` is what makes `CARGO_PKG_VERSION` the + /// workspace's, so comparing that variable to a hardcoded string only ever + /// tests whether the string was updated. It was not, at 0.3.1 -- + /// `cargo test --workspace` failed on a clean tree, and CI never saw it, + /// because its rust job names the crates it tests one at a time and this is + /// not among them. #[test] fn versioned_with_the_workspace() { - assert_eq!(env!("CARGO_PKG_VERSION"), "0.3.0"); + let manifest = include_str!("../Cargo.toml"); + assert!( + manifest + .lines() + .any(|line| line.split_whitespace().collect::() == "version.workspace=true"), + "devlaunch-test-support must take the workspace version, not name one of its own:\n{manifest}" + ); } }