(self, runtests: RunTests, test: str, progress: str)
| 319 | self.display_result(rerun_runtests) |
| 320 | |
| 321 | def _run_bisect(self, runtests: RunTests, test: str, progress: str) -> bool: |
| 322 | print() |
| 323 | title = f"Bisect {test}" |
| 324 | if progress: |
| 325 | title = f"{title} ({progress})" |
| 326 | display_title(title) |
| 327 | |
| 328 | cmd = runtests.create_python_cmd() |
| 329 | cmd.extend([ |
| 330 | "-u", "-m", "test.bisect_cmd", |
| 331 | # Limit to 25 iterations (instead of 100) to not abuse CI resources |
| 332 | "--max-iter", "25", |
| 333 | "-v", |
| 334 | # runtests.match_tests is not used (yet) for bisect_cmd -i arg |
| 335 | ]) |
| 336 | cmd.extend(runtests.bisect_cmd_args()) |
| 337 | cmd.append(test) |
| 338 | print("+", shlex.join(cmd), flush=True) |
| 339 | |
| 340 | flush_std_streams() |
| 341 | |
| 342 | import subprocess |
| 343 | proc = subprocess.run(cmd, timeout=runtests.timeout) |
| 344 | exitcode = proc.returncode |
| 345 | |
| 346 | title = f"{title}: exit code {exitcode}" |
| 347 | display_title(title) |
| 348 | |
| 349 | if exitcode: |
| 350 | print(f"Bisect failed with exit code {exitcode}") |
| 351 | return False |
| 352 | |
| 353 | return True |
| 354 | |
| 355 | def run_bisect(self, runtests: RunTests) -> None: |
| 356 | tests, _ = self.results.prepare_rerun(clear=False) |
no test coverage detected