MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / reduce_actual

Function reduce_actual

tests/test_coverage_children.py:341–358  ·  view source on GitHub ↗
(case, suite, suite_dir, tool, reducer, runner_record, environment)

Source from the content-addressed store, hash-verified

339
340
341def 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
361def features(case_name, tests, events, final, rows):

Callers 1

run_caseFunction · 0.85

Calls 7

strFunction · 0.85
require_processFunction · 0.85
read_logFunction · 0.85
setFunction · 0.85
run_processFunction · 0.70
InfrastructureClass · 0.70
typeFunction · 0.50

Tested by

no test coverage detected