(case, suite, suite_dir, tool, reducer, runner_record, environment)
| 339 | |
| 340 | |
| 341 | def reduce_actual(case, suite, suite_dir, tool, reducer, runner_record, environment): |
| 342 | argv = [sys.executable, str(Path(__file__).resolve()), "--reduce-worker", |
| 343 | "--reducer", reducer, "--suite", suite, "--suite-dir", str(suite_dir), |
| 344 | "--profdata", tool, "--runner-returncode", str(runner_record["returncode"])] |
| 345 | record = run_process(case, "reduce", argv, environment) |
| 346 | require_process(record) |
| 347 | try: |
| 348 | rows = json.loads(read_log(case, record, "stdout")) |
| 349 | except ValueError as exc: |
| 350 | raise Infrastructure("actual reducer did not return valid JSON") from exc |
| 351 | if not isinstance(rows, dict) or len(rows) > 16: |
| 352 | raise Infrastructure("unexpected reducer row inventory") |
| 353 | for row in rows.values(): |
| 354 | if (not isinstance(row, dict) or set(row) != {"status", "reason", "names_count"} |
| 355 | or row["status"] not in ("complete", "incomplete") or not isinstance(row["reason"], str) |
| 356 | or type(row["names_count"]) is not int or row["names_count"] < 0): |
| 357 | raise Infrastructure("invalid actual reducer row") |
| 358 | return rows |
| 359 | |
| 360 | |
| 361 | def features(case_name, tests, events, final, rows): |
no test coverage detected