tests: Do not return a failure when no tests are run

It is a common use case to run a subset of tests locally to verify
certain functionalities.

The default behaviour for nextest is to error out if no tests are run.
That causes the test scripts to return a non-zero value (failure). Pass
`--no-tests=pass` to nextest to match what `cargo test` does if no tests
are run.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2025-11-25 05:12:23 +00:00
committed by Rob Bradford
parent 8c50450002
commit a1a018bd83
7 changed files with 19 additions and 19 deletions

View File

@@ -59,7 +59,7 @@ cargo build --features mshv --all --release --target "$BUILD_TARGET"
export RUST_BACKTRACE=1
export RUSTFLAGS="$RUSTFLAGS"
time cargo nextest run $test_features --test-threads=1 "rate_limiter::$test_filter" -- ${test_binary_args[*]}
time cargo nextest run --no-tests=pass $test_features --test-threads=1 "rate_limiter::$test_filter" -- ${test_binary_args[*]}
RES=$?
exit $RES