Skip to content

Commit d561283

Browse files
sbryngelsonclaude
andcommitted
Add zero-test guard after shard filtering and pin retry action to SHA
- Raise MFCException when --shard produces zero cases (prevents silent green CI with nothing executed) - Pin nick-fields/retry to commit SHA for security on self-hosted runners with cluster credentials Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a1c55ed commit d561283

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ jobs:
254254

255255
- name: Build
256256
if: matrix.cluster != 'phoenix'
257-
uses: nick-fields/retry@v3
257+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
258258
with:
259259
max_attempts: 3
260260
retry_wait_seconds: 60

toolchain/mfc/test/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ def __filter(cases_) -> typing.List[TestCase]:
140140
skipped_cases += [c for i, c in enumerate(cases) if i % shard_count != shard_idx - 1]
141141
cases = [c for i, c in enumerate(cases) if i % shard_count == shard_idx - 1]
142142

143+
if not cases:
144+
raise MFCException(
145+
f"--shard {ARG('shard')} matched zero test cases. "
146+
f"Total cases before sharding may be less than shard count."
147+
)
148+
143149
if ARG("percent") == 100:
144150
return cases, skipped_cases
145151

0 commit comments

Comments
 (0)