Cargo not running integration tests on `cargo test` if version number is big, i.e. `5123.0.0`
Problem
I was surprised to find out that the integration tests located within the tests sub-folder were not being executed when the version was as big as specified in the title, but when a 'normal' value was used, everything ran as expected.
Steps
- Create a test within
tests. - Set the version of the crate to a big number, i.e.
5123.0.0. - Run
cargo test. - Observe that the tests within
testsdo not get executed.
Possible Solution(s)
No response
Notes
It looks like a boundary issues, so the mistake may be on my part for exceeding an existing limit within Cargo's code.
Version
cargo 1.78.0 (54d8815d0 2024-03-26)
release: 1.78.0
commit-hash: 54d8815d04fa3816edc207bbc4dd36bf18014dbc
commit-date: 2024-03-26
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.4.0 (sys:0.4.72+curl-8.6.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1w 11 Sep 2023
os: Mac OS 14.3.1 [64-bit]
I cannot reproduce with the following commands:
cargo new foo --lib
cd foo
echo "[package]" > Cargo.toml
echo "name = 'foo'" >> Cargo.toml
echo "version = '5123.0.0'" >> Cargo.toml
mkdir -p tests
touch tests/bar.rs
cargo +stable t
And got this output:
Creating library `foo` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Compiling foo v5123.0.0 (/home/user/repos/foo)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.28s
Running unittests src/lib.rs (target/debug/deps/foo-f82fbcf55ac84707)
running 1 test
test tests::it_works ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests/bar.rs (target/debug/deps/bar-70708f1a8f83e042)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Doc-tests foo
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Would you mind sharing a minimal reproducible example of it, and also the console output you've got from Cargo that had this issue?
Without a reproduction case, I'm going to go ahead and close this. If you end up coming up with one, let us know!