| 40 | |
| 41 | |
| 42 | def parse_args() -> argparse.Namespace: |
| 43 | parser = argparse.ArgumentParser( |
| 44 | description="Run a bounded parallel wave of test-runner suites" |
| 45 | ) |
| 46 | parser.add_argument("--suite-file", required=True, type=pathlib.Path) |
| 47 | parser.add_argument("--log-dir", required=True, type=pathlib.Path) |
| 48 | parser.add_argument("--results-file", required=True, type=pathlib.Path) |
| 49 | parser.add_argument("--jobs", required=True, type=int) |
| 50 | parser.add_argument("--timeout", required=True, type=int) |
| 51 | parser.add_argument("--slow-timeout", required=True, type=int) |
| 52 | parser.add_argument("--kill-grace", required=True, type=int) |
| 53 | parser.add_argument( |
| 54 | "--test-post-exit-barrier-dir", |
| 55 | type=pathlib.Path, |
| 56 | help=argparse.SUPPRESS, |
| 57 | ) |
| 58 | parser.add_argument( |
| 59 | "--test-pre-terminate-barrier-dir", |
| 60 | type=pathlib.Path, |
| 61 | help=argparse.SUPPRESS, |
| 62 | ) |
| 63 | parser.add_argument( |
| 64 | "runner_command", |
| 65 | nargs="+", |
| 66 | help="runner executable and any fixed arguments; suite name is appended", |
| 67 | ) |
| 68 | args = parser.parse_args() |
| 69 | for name in ("jobs", "timeout", "slow_timeout", "kill_grace"): |
| 70 | if getattr(args, name) < 1: |
| 71 | parser.error(f"--{name.replace('_', '-')} must be at least 1") |
| 72 | return args |
| 73 | |
| 74 | |
| 75 | def read_suites(path: pathlib.Path) -> list[str]: |