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

Method collect

tests/test_coverage_live_v2.py:49–79  ·  view source on GitHub ↗
(self, case, registry, runner=None, destination=None, llvm_bin=None,
                extra=None, poison=False, fault=False)

Source from the content-addressed store, hash-verified

47 return path
48
49 def collect(self, case, registry, runner=None, destination=None, llvm_bin=None,
50 extra=None, poison=False, fault=False):
51 destination = destination or (case / "bundle")
52 runner = str(runner or self.runner)
53 arguments = ["--format", "2", "--runner", runner, "--registry", str(registry),
54 "--out", str(destination), "--llvm-bin", str(llvm_bin or Path(self.tool).parent),
55 "--timeout", "70"] + (extra or [])
56 argv = [sys.executable, self.collector] + arguments
57 if fault:
58 adapter = str(Path(__file__).with_name("coverage_live_v2_fault.py"))
59 argv = [sys.executable, adapter, self.collector, self.runner, SUITE,
60 str(case / "native-fault.json")] + arguments
61 env = clean_env()
62 env["PYTHONDONTWRITEBYTECODE"] = "1"
63 env["LLVM_PROFILE_FILE"] = os.devnull
64 sentinel = None
65 if poison:
66 poison_root = case / "caller-coverage"
67 poison_root.mkdir()
68 sentinel = poison_root / "sentinel"
69 sentinel.write_bytes(b"caller coverage is not the collection destination\n")
70 only_file = case / "caller-selection.txt"
71 only_file.write_text("nonexistent_suite:nonexistent_test\n", encoding="utf-8")
72 env.update(CBM_TEST_COVERAGE_DIR=str(poison_root),
73 CBM_TEST_ONLY="nonexistent_suite:nonexistent_test", CBM_TEST_ONLY_FILE=str(only_file))
74 process = self.processes.run(case.name, argv, env, timeout=600)
75 if sentinel is not None:
76 require(list(sentinel.parent.iterdir()) == [sentinel]
77 and sentinel.read_bytes() == b"caller coverage is not the collection destination\n",
78 "collector used or changed inherited caller coverage directory")
79 return process, destination
80
81
82def fresh_output(value):

Callers 8

runStateFunction · 0.80
positiveFunction · 0.80
failed_nativeFunction · 0.80
image_mismatchFunction · 0.80
existing_outputFunction · 0.80
invalid_registryFunction · 0.80
boundsFunction · 0.80
converter_errorsFunction · 0.80

Calls 6

clean_envFunction · 0.90
requireFunction · 0.90
strFunction · 0.85
updateMethod · 0.80
listFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected