From 2efcf094840316c55e8f1ebfeaa88c15acbe46b8 Mon Sep 17 00:00:00 2001 From: chengxi Date: Fri, 21 Aug 2026 03:20:00 -0400 Subject: [PATCH] ci(rust): don't fail when a DAG scope matches no tests Related to: #3935, as this is why its CI fails. The rail-computed scope for a PR that only touches bdd/rust is a single crate whose test targets are all `required-features = ["bdd"]`. Nothing in this task builds them, so `package(bdd)` matches zero tests and nextest's default `--no-tests=fail` reds a run that broke nothing. Use `warn` rather than `pass` so the other cause of a zero-match filter, a crate rename leaving `package(...)` pointing at nothing, still leaves a line in the log. The unfiltered branch keeps the default, where zero tests means a broken checkout rather than an empty scope. --- .github/actions/rust/pre-merge/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/rust/pre-merge/action.yml b/.github/actions/rust/pre-merge/action.yml index 0c8f47a24f..e2d2d3c302 100644 --- a/.github/actions/rust/pre-merge/action.yml +++ b/.github/actions/rust/pre-merge/action.yml @@ -293,7 +293,12 @@ runs: test_start=$(date +%s) if command -v cargo-nextest &> /dev/null; then if [[ -n "$NEXTEST_FILTER" ]]; then - cargo nextest run --locked --no-fail-fast --profile ci $PARTITION_FLAG $PACKAGE_FLAGS -E "$NEXTEST_FILTER" + # Every test target in the `bdd` crate is `required-features = + # ["bdd"]`, so the `cargo test --no-run` above builds no binaries + # for it. A PR touching only that crate then produces a valid + # filter that matches zero tests, and nextest's default + # `--no-tests=fail` turns that into exit 4 on a green PR. + cargo nextest run --locked --no-fail-fast --no-tests=warn --profile ci $PARTITION_FLAG $PACKAGE_FLAGS -E "$NEXTEST_FILTER" else cargo nextest run --locked --no-fail-fast --profile ci $PARTITION_FLAG fi