From 4926984dc8832230bcb4fd2427d8af3e689d05b6 Mon Sep 17 00:00:00 2001 From: Rain Date: Mon, 10 Feb 2025 17:31:58 +0000 Subject: [PATCH] [cargo-nextest] don't require equals for `--max-fail` and `--no-tests` This was previously done to avoid confusion between test name filters and arguments. But we believe the new `--no-tests` default to fail sufficiently mitigates the downside, and uniformity across options is valuable. Closes #1933. --- cargo-nextest/src/dispatch.rs | 4 ++-- integration-tests/tests/integration/main.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cargo-nextest/src/dispatch.rs b/cargo-nextest/src/dispatch.rs index 8628261d96c..2cf7de13fc9 100644 --- a/cargo-nextest/src/dispatch.rs +++ b/cargo-nextest/src/dispatch.rs @@ -858,7 +858,6 @@ pub struct TestRunnerOpts { name = "max-fail", value_name = "N", conflicts_with_all = &["no-run", "fail-fast", "no-fail-fast"], - require_equals = true, )] max_fail: Option, @@ -868,7 +867,6 @@ pub struct TestRunnerOpts { value_enum, conflicts_with = "no-run", value_name = "ACTION", - require_equals = true, env = "NEXTEST_NO_TESTS" )] no_tests: Option, @@ -2433,6 +2431,8 @@ mod tests { "cargo nextest run --nocapture", "cargo nextest run --no-run", "cargo nextest run --final-status-level flaky", + "cargo nextest run --max-fail 3", + "cargo nextest run --max-fail=all", // retry is an alias for flaky -- ensure that it parses "cargo nextest run --final-status-level retry", "NEXTEST_HIDE_PROGRESS_BAR=1 cargo nextest run", diff --git a/integration-tests/tests/integration/main.rs b/integration-tests/tests/integration/main.rs index 3660d39dff0..d38cffef361 100644 --- a/integration-tests/tests/integration/main.rs +++ b/integration-tests/tests/integration/main.rs @@ -336,7 +336,8 @@ fn test_run_no_tests() { "run", "-E", "none()", - "--no-tests=warn", + "--no-tests", + "warn", ]) .output();