We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5dfa1f commit 475caa3Copy full SHA for 475caa3
1 file changed
toolchain/mfc/test/test.py
@@ -100,7 +100,10 @@ def __filter(cases_) -> typing.List[TestCase]:
100
cases = [case for case in cases if case not in example_cases]
101
102
if ARG("shard") is not None:
103
- shard_idx, shard_count = (int(x) for x in ARG("shard").split("/"))
+ parts = ARG("shard").split("/")
104
+ if len(parts) != 2 or not all(p.isdigit() for p in parts) or int(parts[1]) < 1 or not 1 <= int(parts[0]) <= int(parts[1]):
105
+ raise MFCException(f"Invalid --shard '{ARG('shard')}': expected 'i/n' with 1 <= i <= n (e.g., '1/2').")
106
+ shard_idx, shard_count = int(parts[0]), int(parts[1])
107
skipped_cases += [c for i, c in enumerate(cases) if i % shard_count != shard_idx - 1]
108
cases = [c for i, c in enumerate(cases) if i % shard_count == shard_idx - 1]
109
0 commit comments