Skip to content

Commit 3eaba1c

Browse files
committed
ci(test): make --select-enforce imply selection (drop redundant --only-changes)
--select-enforce previously did nothing without --only-changes, so the enforce config had to pass both. Gate the selection block on either flag: --select-enforce alone now selects AND prunes; --only-changes alone stays shadow (print selection, run full suite). CI enforce paths simplify to just --select-enforce --changed-files.
1 parent bcaff12 commit 3eaba1c

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/common/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fi
6464
# paths-filter list.
6565
select_opts=""
6666
if [ "${GITHUB_EVENT_NAME:-}" = "pull_request" ]; then
67-
select_opts="--only-changes --select-enforce"
67+
select_opts="--select-enforce"
6868
fi
6969

7070
./mfc.sh test -v --max-attempts 3 --no-build $select_opts -a -j $n_test_threads $rdma_opts $device_opts $build_opts $shard_opts -- -c $job_cluster

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ jobs:
270270
# run-all). Pushes to master run the full suite (SELECT empty) as a backstop,
271271
# and the NVHPC jobs below still run --test-all as a pre-merge full check.
272272
SELECT=()
273-
[ "${{ github.event_name }}" = "pull_request" ] && SELECT=(--only-changes --select-enforce --changed-files "$CHANGED_FILES")
273+
[ "${{ github.event_name }}" = "pull_request" ] && SELECT=(--select-enforce --changed-files "$CHANGED_FILES")
274274
/bin/bash mfc.sh test -v --max-attempts 3 -j $(nproc) "${SELECT[@]}" $TEST_ALL $TEST_PCT $PRECISION
275275
env:
276276
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}

toolchain/mfc/cli/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,14 +472,14 @@
472472
dest="only_changes",
473473
action=ArgAction.STORE_TRUE,
474474
default=False,
475-
help="Select only tests whose covered files overlap changed files (shadow mode unless --select-enforce).",
475+
help="Shadow mode: compute and print the coverage-based test selection but still run the full suite. Use --select-enforce to actually prune.",
476476
),
477477
Argument(
478478
name="select-enforce",
479479
dest="select_enforce",
480480
action=ArgAction.STORE_TRUE,
481481
default=False,
482-
help="With --only-changes, actually skip unselected tests (otherwise shadow: print selection, run all).",
482+
help="Run only the coverage-selected tests (implies selection; skips unselected tests). Without it, --only-changes is shadow-only.",
483483
),
484484
Argument(name="changed-files", dest="changed_files", type=str, default=None, help="Changed-file list (newline-, space-, or comma-separated; from CI paths-filter). Overrides git detection."),
485485
Argument(name="changes-branch", dest="changes_branch", type=str, default="master", help="Branch to diff against for --only-changes."),

toolchain/mfc/test/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def is_uuid(term):
178178
if not cases:
179179
raise MFCException(f"--shard {ARG('shard')} matched zero test cases. Total cases before sharding may be less than shard count.")
180180

181-
if ARG("only_changes"):
181+
if ARG("only_changes") or ARG("select_enforce"):
182182
import datetime
183183

184184
from .. import common

0 commit comments

Comments
 (0)