Skip to content

Commit bcaff12

Browse files
committed
ci(test): enforce coverage-based test selection on PRs
Flip the shadow --only-changes selection to --select-enforce on PR runs for the github (GNU/intel) jobs and the self-hosted Phoenix/Frontier jobs. PRs now run only the tests whose recorded coverage overlaps the changed files; the conservative ladder in coverage.py falls back to run-all for non-.fpp changes and .fpp files no test covers. Backstops retained: the NVHPC jobs still run --test-all on every PR (pre-merge full check), and pushes to master run the full suite (SELECT empty).
1 parent 47b56e8 commit bcaff12

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/common/test.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ if [ -n "${job_shard:-}" ]; then
5757
shard_opts="--shard $job_shard"
5858
fi
5959

60-
# Coverage-based test selection in SHADOW mode on PRs: prints what it WOULD select but the
61-
# full suite still runs (no --select-enforce). Changed files come from git detection
62-
# (self-healing deepen) since the SLURM job doesn't receive the paths-filter list.
60+
# Coverage-based test selection ENFORCED on PRs: runs only tests whose recorded coverage
61+
# overlaps the PR's changed files (conservative ladder; non-.fpp and uncovered-.fpp changes
62+
# fall back to run-all). Pushes to master run the full suite as a backstop. Changed files
63+
# come from git detection (self-healing deepen) since the SLURM job doesn't receive the
64+
# paths-filter list.
6365
select_opts=""
6466
if [ "${GITHUB_EVENT_NAME:-}" = "pull_request" ]; then
65-
select_opts="--only-changes"
67+
select_opts="--only-changes --select-enforce"
6668
fi
6769

6870
./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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,13 @@ jobs:
264264
- name: Test
265265
if: '!matrix.nvhpc'
266266
run: |
267-
# Coverage-based test selection in SHADOW mode on PRs: the selector
268-
# prints what it WOULD run, but the full suite still runs (no
269-
# --select-enforce). Enforcement is a separate, later change.
267+
# Coverage-based test selection ENFORCED on PRs: runs only the tests whose
268+
# recorded coverage overlaps the PR's changed files (conservative ladder in
269+
# coverage.py — non-.fpp changes and .fpp files no test covers fall back to
270+
# run-all). Pushes to master run the full suite (SELECT empty) as a backstop,
271+
# and the NVHPC jobs below still run --test-all as a pre-merge full check.
270272
SELECT=()
271-
[ "${{ github.event_name }}" = "pull_request" ] && SELECT=(--only-changes --changed-files "$CHANGED_FILES")
273+
[ "${{ github.event_name }}" = "pull_request" ] && SELECT=(--only-changes --select-enforce --changed-files "$CHANGED_FILES")
272274
/bin/bash mfc.sh test -v --max-attempts 3 -j $(nproc) "${SELECT[@]}" $TEST_ALL $TEST_PCT $PRECISION
273275
env:
274276
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}

0 commit comments

Comments
 (0)