fix(rees): run REES coverage's test child from review-enrichment/#8616
Conversation
spawnSync ran c8 and the node:test child it wraps with the same cwd (the monorepo root), needed so c8's lcov SF: paths remap to review-enrichment/src/** for Codecov. But that left the actual test process running from the wrong directory, so tests that read fixtures via bare relative paths (e.g. analyzer-metadata.test.ts reading "analyzer-metadata.json") failed with ENOENT even though the fixture exists at review-enrichment/analyzer-metadata.json. Preload a small --require script into only the spawned test child to chdir it into review-enrichment/ before node:test loads any files, leaving c8's own process cwd (and therefore its SF: path remapping) untouched. Test file arguments switch from root-relative to absolute paths since they're now resolved from a different cwd.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-25 09:49:30 UTC
Review summary Nits — 6 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
scripts/rees-coverage.tsspawned c8 and thenode:testchild it wraps with the samecwd(the monorepo root) — needed so c8's lcovSF:paths remap toreview-enrichment/src/**for Codecov — but this left the actual test process running from the wrong directory, so tests reading fixtures via bare relative paths (e.g.analyzer-metadata.test.tsreading"analyzer-metadata.json") failed withENOENTeven though the fixture exists atreview-enrichment/analyzer-metadata.json.scripts/rees-coverage-chdir.cjs, preloaded via--requireinto only the spawned test child, chdir'ing it intoreview-enrichment/beforenode:testloads any files. c8's own process cwd (and itsSF:path remapping) is untouched.npm run rees:coverage, uploaded with|| truein CI since c8 instrumentation is known to blow timing-sensitive budgets) — it is not the actual REES gate (npm --prefix review-enrichment test, unaffected by this bug and already passing).Test plan
node --experimental-strip-types scripts/rees-coverage.ts— 1376/1376 pass, 0 failures (previously 1 ENOENT failure)npm run test:node --prefix review-enrichment— same test count, clean pass, confirms paritylcov.info'sSF:lines all remainreview-enrichment/src/**(unchanged from pre-fix behavior)npx tsc --noEmitclean