From b59dea826f7d8c62072be582a0b398d4641078de Mon Sep 17 00:00:00 2001 From: cxymds Date: Sun, 6 Sep 2026 09:21:11 +0800 Subject: [PATCH] fix(ci): enable test utilities in migration gate (#7246) --- .config/migration-gate-floor.txt | 9 +++++---- scripts/check_migration_gate_count.sh | 11 +++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.config/migration-gate-floor.txt b/.config/migration-gate-floor.txt index 1da7a3af2..9abadcffd 100644 --- a/.config/migration-gate-floor.txt +++ b/.config/migration-gate-floor.txt @@ -1,10 +1,11 @@ # Committed floor for the number of tests selected by the migration-critical # CI gate (see scripts/check_migration_gate_count.sh, backlog#1153 infra-12). # -# The floor equals the exact count of rustfs-ecstore --lib tests matching the -# gate filter (name substrings: data_movement, rebalance, decommission, -# source_cleanup, delete_marker) at the time this file was last updated. +# The floor equals the exact count of rustfs-ecstore --lib tests, with the +# test-util feature enabled, matching the gate filter (name substrings: +# data_movement, rebalance, decommission, source_cleanup, delete_marker) at +# the time this file was last updated. # CI fails if the selected count drops below this number, so renames or # removals that thin the gate must update this file in the same PR. # Adding tests does not require a bump, but bumping keeps the guard tight. -571 +946 diff --git a/scripts/check_migration_gate_count.sh b/scripts/check_migration_gate_count.sh index 0e3bf0a6c..7ee471ed1 100755 --- a/scripts/check_migration_gate_count.sh +++ b/scripts/check_migration_gate_count.sh @@ -33,8 +33,11 @@ set -euo pipefail cd "$(dirname "$0")/.." -# Single source of truth for the migration-gate filter. ci.yml must invoke -# this script instead of inlining the expression. +# Single source of truth for the migration-gate target and filter. The +# test-util feature activates migration-critical tests that otherwise leave +# their shared fixtures compiled but unused. ci.yml must invoke this script +# instead of inlining either selection. +MIGRATION_GATE_TARGET_ARGS=(-p rustfs-ecstore --lib --features test-util) MIGRATION_GATE_FILTER='test(data_movement) or test(rebalance) or test(decommission) or test(source_cleanup) or test(delete_marker)' FLOOR_FILE=".config/migration-gate-floor.txt" @@ -60,7 +63,7 @@ if [[ "$mode" == "all" || "$mode" == "check" ]]; then # count to 0 and failing every PR). A nextest failure aborts via set -e # with its stderr visible; a JSON schema change makes jq fail loudly # rather than silently passing. - count="$(cargo nextest list -p rustfs-ecstore --lib -E "$MIGRATION_GATE_FILTER" --message-format json \ + count="$(cargo nextest list "${MIGRATION_GATE_TARGET_ARGS[@]}" -E "$MIGRATION_GATE_FILTER" --message-format json \ | jq '[."rust-suites"[].testcases[] | select(."filter-match".status == "matches")] | length')" if ! [[ "$count" =~ ^[0-9]+$ ]]; then echo "error: could not parse nextest JSON listing (got count: '$count')" >&2 @@ -81,5 +84,5 @@ if [[ "$mode" == "all" || "$mode" == "check" ]]; then fi if [[ "$mode" == "all" || "$mode" == "run" ]]; then - cargo nextest run -p rustfs-ecstore --lib -E "$MIGRATION_GATE_FILTER" + cargo nextest run "${MIGRATION_GATE_TARGET_ARGS[@]}" -E "$MIGRATION_GATE_FILTER" fi