Extract tests that required reruns from test-stats.json.
(test_stats: dict[str, Any])
| 107 | |
| 108 | |
| 109 | def _extract_flaky_tests(test_stats: dict[str, Any]) -> list[dict[str, Any]]: |
| 110 | """Extract tests that required reruns from test-stats.json.""" |
| 111 | return [ |
| 112 | { |
| 113 | "nodeid": detail["nodeid"], |
| 114 | "rerun_count": detail.get("rerun_count", 0), |
| 115 | "browser": detail.get("browser", "unknown"), |
| 116 | "final_outcome": detail.get("final_outcome", "unknown"), |
| 117 | } |
| 118 | for detail in test_stats.get("rerun_details", []) |
| 119 | if detail.get("rerun_count", 0) > 0 |
| 120 | ] |
| 121 | |
| 122 | |
| 123 | def _normalize_test_name(nodeid: str) -> str: |