| 67 | |
| 68 | |
| 69 | def parse_args() -> argparse.Namespace: |
| 70 | parser = argparse.ArgumentParser( |
| 71 | description="Run a bounded parallel wave of test-runner suites" |
| 72 | ) |
| 73 | parser.add_argument("--suite-file", required=True, type=pathlib.Path) |
| 74 | parser.add_argument("--log-dir", required=True, type=pathlib.Path) |
| 75 | parser.add_argument("--results-file", required=True, type=pathlib.Path) |
| 76 | parser.add_argument("--jobs", required=True, type=int) |
| 77 | parser.add_argument("--timeout", required=True, type=int) |
| 78 | parser.add_argument("--slow-timeout", required=True, type=int) |
| 79 | parser.add_argument("--kill-grace", required=True, type=int) |
| 80 | parser.add_argument( |
| 81 | "--test-post-exit-barrier-dir", |
| 82 | type=pathlib.Path, |
| 83 | help=argparse.SUPPRESS, |
| 84 | ) |
| 85 | parser.add_argument( |
| 86 | "--test-pre-terminate-barrier-dir", |
| 87 | type=pathlib.Path, |
| 88 | help=argparse.SUPPRESS, |
| 89 | ) |
| 90 | parser.add_argument( |
| 91 | "runner_command", |
| 92 | nargs="+", |
| 93 | help="runner executable and any fixed arguments; suite name is appended", |
| 94 | ) |
| 95 | args = parser.parse_args() |
| 96 | for name in ("jobs", "timeout", "slow_timeout", "kill_grace"): |
| 97 | if getattr(args, name) < 1: |
| 98 | parser.error(f"--{name.replace('_', '-')} must be at least 1") |
| 99 | return args |
| 100 | |
| 101 | |
| 102 | def read_suites(path: pathlib.Path) -> list[str]: |