mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-06 03:59:14 +00:00
fix(ci): enable test utilities in migration gate (#7246)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user