Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion rust/devlaunch-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<String>() == "version.workspace=true"),
"devlaunch-test-support must take the workspace version, not name one of its own:\n{manifest}"
);
}
}