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

Method reduce

tests/test_coverage_terminal.py:170–189  ·  view source on GitHub ↗
(self, case, directory, code)

Source from the content-addressed store, hash-verified

168 "count": exact[0]["counts"][0]}
169
170 def reduce(self, case, directory, code):
171 # The pinned reducer invokes exactly one profdata reader per admitted raw
172 # profile here. Reserve those nested processes before launching its group.
173 self.inventory(directory)
174 for name in RAW_NAMES:
175 self.charge("reserved_reducer_process", name)
176 argv = [sys.executable, self.inputs["driver"]["path"], "--reduce-worker",
177 "--helper", self.inputs["helper"]["path"],
178 "--reducer", self.inputs["reducer"]["path"],
179 "--suite-dir", str(directory), "--profdata", self.tool,
180 "--runner-returncode", str(code)]
181 record = self.run(case, "actual-reducer", argv, self.environment, success=True)
182 rows = json.loads(self.log(case, record, "stdout"))
183 require(isinstance(rows, dict) and set(rows) == {TEST, "*"}, "unexpected actual reducer rows")
184 for row in rows.values():
185 require(isinstance(row, dict) and set(row) == {"status", "reason", "names_count"}
186 and row["status"] in ("complete", "incomplete")
187 and isinstance(row["reason"], str) and type(row["names_count"]) is int
188 and row["names_count"] >= 0, "invalid actual reducer response")
189 return rows
190
191 def body(self, stdout, code):
192 rows = re.findall(r"(?m)^ ([A-Za-z_][A-Za-z0-9_]*)[ \t]+(PASS|FAIL|SKIP)\b", stdout)

Callers 15

caseMethod · 0.95
galaxyZoomFunction · 0.80
meanFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
totalFunction · 0.80
checkK5Function · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 8

inventoryMethod · 0.95
chargeMethod · 0.95
runMethod · 0.95
logMethod · 0.95
strFunction · 0.85
setFunction · 0.85
requireFunction · 0.70
typeFunction · 0.50

Tested by

no test coverage detected