MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / verifyCoverage

Function verifyCoverage

scripts/run-bench-ci.mjs:361–405  ·  view source on GitHub ↗
(profile, run)

Source from the content-addressed store, hash-verified

359}
360
361function verifyCoverage(profile, run) {
362 const index = new Map();
363
364 for (const entry of run.results) {
365 if (!isPlainObject(entry)) continue;
366 if (entry.framework !== profile.framework) continue;
367 const scenario =
368 typeof entry.scenario === "string" && entry.scenario.length > 0 ? entry.scenario : null;
369 if (!scenario) continue;
370 const params = normalizeParams(entry.params ?? {}, `results.params(${scenario})`);
371 const key = makeKey(scenario, profile.framework, params);
372 index.set(key, true);
373 }
374
375 for (const scenario of profile.requiredScenarios) {
376 const hasAnyForScenario = [...index.keys()].some((key) =>
377 key.startsWith(`${scenario}|${profile.framework}|`),
378 );
379 if (!hasAnyForScenario) {
380 fail(`required scenario missing from output: ${scenario} [${profile.framework}]`);
381 }
382 }
383
384 for (const [scenario, paramSets] of profile.requiredScenarioParams.entries()) {
385 for (const params of paramSets) {
386 const key = makeKey(scenario, profile.framework, params);
387 if (!index.has(key)) {
388 fail(
389 `required scenario+params missing from output: ${scenario} [${profile.framework}] params=${stableStringify(
390 params,
391 )}`,
392 );
393 }
394 }
395 }
396
397 return {
398 requiredScenarios: profile.requiredScenarios.length,
399 requiredParamRows: [...profile.requiredScenarioParams.values()].reduce(
400 (sum, paramSets) => sum + paramSets.length,
401 0,
402 ),
403 frameworkResultRows: [...index.keys()].length,
404 };
405}
406
407async function main() {
408 const { outputDir: outputDirArg } = parseArgs(process.argv.slice(2));

Callers 1

mainFunction · 0.85

Calls 10

isPlainObjectFunction · 0.70
normalizeParamsFunction · 0.70
makeKeyFunction · 0.70
failFunction · 0.70
stableStringifyFunction · 0.70
keysMethod · 0.65
setMethod · 0.45
entriesMethod · 0.45
hasMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected