| 99 | |
| 100 | |
| 101 | def parse_args() -> argparse.Namespace: |
| 102 | parser = argparse.ArgumentParser( |
| 103 | description="Run a bounded parallel wave of test-runner suites" |
| 104 | ) |
| 105 | parser.add_argument("--suite-file", required=True, type=pathlib.Path) |
| 106 | parser.add_argument("--log-dir", required=True, type=pathlib.Path) |
| 107 | parser.add_argument("--results-file", required=True, type=pathlib.Path) |
| 108 | parser.add_argument("--jobs", required=True, type=int) |
| 109 | parser.add_argument("--timeout", required=True, type=int) |
| 110 | parser.add_argument("--slow-timeout", required=True, type=int) |
| 111 | parser.add_argument("--kill-grace", required=True, type=int) |
| 112 | parser.add_argument( |
| 113 | "--test-post-exit-barrier-dir", |
| 114 | type=pathlib.Path, |
| 115 | help=argparse.SUPPRESS, |
| 116 | ) |
| 117 | parser.add_argument( |
| 118 | "--test-pre-terminate-barrier-dir", |
| 119 | type=pathlib.Path, |
| 120 | help=argparse.SUPPRESS, |
| 121 | ) |
| 122 | parser.add_argument( |
| 123 | "runner_command", |
| 124 | nargs="+", |
| 125 | help="runner executable and any fixed arguments; suite name is appended", |
| 126 | ) |
| 127 | args = parser.parse_args() |
| 128 | for name in ("jobs", "timeout", "slow_timeout", "kill_grace"): |
| 129 | if getattr(args, name) < 1: |
| 130 | parser.error(f"--{name.replace('_', '-')} must be at least 1") |
| 131 | return args |
| 132 | |
| 133 | |
| 134 | def read_suites(path: pathlib.Path) -> list[str]: |