Skip to content

test(coverage): collect integration coverage with native V8 instead of istanbul#9091

Merged
BridgeAR merged 11 commits into
masterfrom
BridgeAR/2026-06-26-c8-native-coverage
Jul 7, 2026
Merged

test(coverage): collect integration coverage with native V8 instead of istanbul#9091
BridgeAR merged 11 commits into
masterfrom
BridgeAR/2026-06-26-c8-native-coverage

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Replace the istanbul-based integration coverage harness with native V8 coverage (c8).

The old harness instrumented dd-trace's source to count lines — nyc's require-hook in every spawned child plus a pack-time istanbul rewrite of the sandbox tarball. That transform is the dominant cost of a coverage run (~4x wall time on spawn-heavy suites, enough to time out child_process tests on slower runners) and it breaks --enable-source-maps, which is why several fixtures opt out of coverage entirely.

Now every process in the tree writes a raw V8 profile into one shared collector directory via NODE_V8_COVERAGE; after mocha exits, merge-lcov.js converts each profile through v8-to-istanbul into the same coverage/node-<version> lcov the upload step already reads. No source is transformed, so ESM and source-mapped files are covered without a hook.

  1. patch-child-process.js injects NODE_V8_COVERAGE (plus a minimal bootstrap require that only re-installs the patch) into children, including those that replace env. The per-spawn opt-out blanks NODE_V8_COVERAGE rather than omitting it, because Node copies the parent's value to a child otherwise.
  2. child-bootstrap.js drops nyc.wrap() / the pre-instrumented writer and instead flushes via v8.takeCoverage() on SIGTERM/SIGINT, so a long-running fixture the harness stops with a signal still contributes coverage.
  3. The in-process test:*:ci suites move from nyc to c8 via scripts/c8-ci.js.
  4. scripts/patch-v8-to-istanbul.js corrects V8's line-coverage over-report on multi-line statements (an indented, un-taken ternary/logical arm is otherwise reported as covered), keeping c8's line numbers aligned with the statement-granular istanbul baseline Codecov was built against.

Deletes the pack-time instrumenter, the pre-instrumented writer, the sandbox nyc config, and the per-sandbox finalize step — all of which existed only to get istanbul counters into child processes.

Why

V8 coverage removes the instrumentation transform that motivated the entire pre-instrumented-tarball machinery, dissolving both its ~4x overhead (the root cause of the child_process CI timeouts) and its source-map breakage. The line-coverage patch matches the existing istanbul getLineCoverage patch in spirit so the migration does not move Codecov's line numbers under teams.

Depending on #9094

@dd-octo-sts

dd-octo-sts Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.59 MB
Deduped: 7.25 MB
No deduping: 7.25 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 437.94 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jun 26, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 96.47% (+8.88%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7d3b45e | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jun 26, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-07 14:12:54

Comparing candidate commit 7d3b45e in PR branch BridgeAR/2026-06-26-c8-native-coverage with baseline commit 872f1a8 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2253 metrics, 33 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-178.993ms; +176.580ms] or [-6.804%; +6.712%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-202.581ms; +206.230ms] or [-8.075%; +8.220%]

scenario:appsec-control-20

  • unstable execution_time [-117.468ms; +111.743ms] or [-7.210%; +6.859%]

scenario:appsec-control-24

  • unstable execution_time [-105839.680µs; +105589.080µs] or [-8.707%; +8.686%]

scenario:appsec-control-26

  • unstable execution_time [-113133.144µs; +112910.944µs] or [-9.360%; +9.342%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-12.238ms; +14.757ms] or [-4.910%; +5.920%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-2.519s; +0.210s] or [-27.659%; +2.303%]
  • unstable execution_time [-2.565s; +0.236s] or [-26.112%; +2.400%]
  • unstable instructions [-21.5G instructions; +1.7G instructions] or [-28.714%; +2.292%]
  • unstable throughput [-65.180op/s; +730.623op/s] or [-1.928%; +21.610%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-1.634s; +5.291s] or [-15.367%; +49.766%]
  • unstable execution_time [-1.607s; +5.307s] or [-14.169%; +46.798%]
  • unstable instructions [-14.6G instructions; +47.4G instructions] or [-16.444%; +53.197%]
  • unstable max_rss_usage [-5.885MB; +16.975MB] or [-3.628%; +10.465%]
  • unstable throughput [-1147.224op/s; +344.074op/s] or [-38.507%; +11.549%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-2.404s; +0.264s] or [-26.074%; +2.862%]
  • unstable execution_time [-2.438s; +0.260s] or [-24.619%; +2.623%]
  • unstable instructions [-20.7G instructions; +2.2G instructions] or [-27.495%; +2.891%]
  • unstable throughput [-72.644op/s; +671.331op/s] or [-2.171%; +20.060%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-2.590s; +0.349s] or [-30.487%; +4.103%]
  • unstable execution_time [-2.606s; +0.342s] or [-28.334%; +3.713%]
  • unstable instructions [-22.1G instructions; +3.0G instructions] or [-31.874%; +4.262%]
  • unstable throughput [-99.757op/s; +764.678op/s] or [-2.728%; +20.909%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-1.649s; +5.390s] or [-15.559%; +50.842%]
  • unstable execution_time [-1.690s; +5.427s] or [-14.960%; +48.039%]
  • unstable instructions [-14.5G instructions; +47.9G instructions] or [-16.267%; +53.882%]
  • unstable max_rss_usage [-5.143MB; +16.623MB] or [-3.160%; +10.213%]
  • unstable throughput [-1182.701op/s; +370.563op/s] or [-39.436%; +12.356%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-252.167ms; +409.827ms] or [-5.094%; +8.279%]
  • unstable execution_time [-249.418ms; +409.633ms] or [-4.962%; +8.150%]
  • unstable throughput [-141260.132op/s; +84854.007op/s] or [-8.459%; +5.081%]

scenario:plugin-graphql-long-with-depth-off-20

  • unstable max_rss_usage [-6303.416KB; +7797.130KB] or [-4.883%; +6.040%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-4748.588KB; +6032.588KB] or [-5.904%; +7.501%]

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.51%. Comparing base (872f1a8) to head (7d3b45e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9091      +/-   ##
==========================================
+ Coverage   93.48%   96.51%   +3.02%     
==========================================
  Files         901      905       +4     
  Lines       53308   119150   +65842     
  Branches    12583    20211    +7628     
==========================================
+ Hits        49833   114993   +65160     
- Misses       3475     4157     +682     
Flag Coverage Δ
aiguard 53.53% <ø> (+18.57%) ⬆️
aiguard-integration 57.37% <ø> (+15.50%) ⬆️
apm-bucket-0 53.76% <ø> (+18.88%) ⬆️
apm-bucket-1 58.07% <ø> (+17.62%) ⬆️
apm-bucket-2 56.09% <ø> (+18.63%) ⬆️
apm-capabilities-tracing 61.00% <ø> (+11.98%) ⬆️
apm-integrations-aerospike 52.91% <ø> (+19.80%) ⬆️
apm-integrations-confluentinc-kafka-javascript 57.05% <ø> (+17.07%) ⬆️
apm-integrations-couchbase 53.23% <ø> (+19.84%) ⬆️
apm-integrations-http 57.96% <ø> (+15.97%) ⬆️
apm-integrations-kafkajs 57.69% <ø> (+17.48%) ⬆️
apm-integrations-next 54.21% <ø> (+24.62%) ⬆️
apm-integrations-prisma 54.17% <ø> (+19.01%) ⬆️
apm-integrations-tedious 53.01% <ø> (+18.98%) ⬆️
appsec 69.06% <ø> (+11.29%) ⬆️
appsec-express_fastify_graphql 65.67% <ø> (+11.88%) ⬆️
appsec-integration 45.82% <ø> (+10.41%) ⬆️
appsec-kafka_ldapjs_lodash 59.10% <ø> (+15.40%) ⬆️
appsec-mongodb-core_mongoose_mysql 62.30% <ø> (+13.47%) ⬆️
appsec-next 52.83% <ø> (+25.15%) ⬆️
appsec-node-serialize_passport_postgres 61.90% <ø> (+13.89%) ⬆️
appsec-sourcing_stripe_template 60.25% <ø> (+14.68%) ⬆️
debugger 65.67% <ø> (+21.12%) ⬆️
instrumentations-bucket-0 48.73% <ø> (+20.56%) ⬆️
instrumentations-bucket-1 54.94% <ø> (+17.37%) ⬆️
instrumentations-bucket-10 56.62% <ø> (+16.16%) ⬆️
instrumentations-bucket-11 48.70% <ø> (+20.73%) ⬆️
instrumentations-bucket-12 48.80% <ø> (+20.01%) ⬆️
instrumentations-bucket-13 48.64% <ø> (+20.83%) ⬆️
instrumentations-bucket-2 49.70% <ø> (+19.34%) ⬆️
instrumentations-bucket-3 53.81% <ø> (+17.77%) ⬆️
instrumentations-bucket-4 49.12% <ø> (+20.52%) ⬆️
instrumentations-bucket-5 52.98% <ø> (+16.72%) ⬆️
instrumentations-bucket-6 55.59% <ø> (+17.21%) ⬆️
instrumentations-bucket-7 53.58% <ø> (+17.55%) ⬆️
instrumentations-bucket-8 54.62% <ø> (+17.54%) ⬆️
instrumentations-bucket-9 56.08% <ø> (+16.51%) ⬆️
instrumentations-instrumentation-couchbase 48.13% <ø> (+1.65%) ⬆️
instrumentations-integration-esbuild 34.20% <ø> (+10.01%) ⬆️
llmobs-ai_anthropic_bedrock 57.26% <ø> (+17.62%) ⬆️
llmobs-google-genai_langchain_vertex-ai 55.76% <ø> (+18.80%) ⬆️
llmobs-openai 57.56% <ø> (+17.86%) ⬆️
llmobs-sdk 59.96% <ø> (+16.44%) ⬆️
master-coverage 96.51% <ø> (?)
openfeature 54.57% <ø> (+16.74%) ⬆️
openfeature-unit 49.78% <ø> (-0.70%) ⬇️
platform-core_esbuild_instrumentations-misc 38.66% <ø> (+16.02%) ⬆️
platform-integration 62.16% <ø> (+14.73%) ⬆️
platform-shimmer_unit-guardrails_webpack 37.45% <ø> (+19.27%) ⬆️
plugins-bucket-0 53.16% <ø> (+16.66%) ⬆️
plugins-bucket-1 55.05% <ø> (+15.38%) ⬆️
plugins-bucket-11 56.70% <ø> (+18.12%) ⬆️
plugins-bucket-17 56.73% <ø> (+17.56%) ⬆️
plugins-bucket-18 57.54% <ø> (+15.42%) ⬆️
plugins-bucket-19 57.06% <ø> (+17.14%) ⬆️
plugins-bucket-20 59.34% <ø> (+15.97%) ⬆️
plugins-bucket-4 53.83% <ø> (+15.97%) ⬆️
plugins-bullmq_cassandra_cookie 57.38% <ø> (+17.50%) ⬆️
plugins-cookie-parser_crypto_dd-trace-api 52.29% <ø> (+19.08%) ⬆️
plugins-fetch_fs_generic-pool 54.44% <ø> (+18.26%) ⬆️
plugins-google-cloud-pubsub_grpc_handlebars 59.87% <ø> (+16.84%) ⬆️
plugins-hapi_hono_ioredis 55.84% <ø> (+17.94%) ⬆️
plugins-jest_knex_langgraph 51.63% <ø> (+19.03%) ⬆️
plugins-ldapjs_light-my-request_limitd-client 53.39% <ø> (+25.45%) ⬆️
plugins-lodash_mariadb_memcached 54.18% <ø> (+19.03%) ⬆️
plugins-mongodb_mongodb-core_mongoose 55.10% <ø> (+18.67%) ⬆️
plugins-multer_mysql_mysql2 54.35% <ø> (+19.22%) ⬆️
plugins-nats_node-serialize_opensearch 56.04% <ø> (+18.77%) ⬆️
plugins-passport-http_pino_postgres 54.72% <ø> (+19.22%) ⬆️
plugins-process_pug_redis 53.84% <ø> (+19.60%) ⬆️
plugins-undici_url_valkey 54.36% <ø> (+18.48%) ⬆️
plugins-vm_winston_ws 55.25% <ø> (+17.57%) ⬆️
profiling 58.19% <ø> (+14.41%) ⬆️
serverless-aws-sdk-aws-sdk 50.63% <ø> (+17.44%) ⬆️
serverless-aws-sdk-bedrockruntime 50.65% <ø> (+18.46%) ⬆️
serverless-aws-sdk-client 51.93% <ø> (+14.76%) ⬆️
serverless-aws-sdk-dynamodb 51.72% <ø> (+17.55%) ⬆️
serverless-aws-sdk-eventbridge 46.18% <ø> (+18.91%) ⬆️
serverless-aws-sdk-kinesis 54.68% <ø> (+17.17%) ⬆️
serverless-aws-sdk-lambda 52.75% <ø> (+18.14%) ⬆️
serverless-aws-sdk-s3 51.49% <ø> (+18.87%) ⬆️
serverless-aws-sdk-serverless-peer-service 54.70% <ø> (+15.02%) ⬆️
serverless-aws-sdk-sns 55.46% <ø> (+17.09%) ⬆️
serverless-aws-sdk-sqs 55.89% <ø> (+17.78%) ⬆️
serverless-aws-sdk-stepfunctions 51.22% <ø> (+18.01%) ⬆️
serverless-aws-sdk-util 48.41% <ø> (+0.46%) ⬆️
serverless-bucket-0 55.21% <ø> (+15.69%) ⬆️
serverless-bucket-1 55.99% <ø> (?)
serverless-lambda ?
test-optimization-cucumber 72.93% <ø> (+20.49%) ⬆️
test-optimization-cypress 66.34% <ø> (+16.54%) ⬆️
test-optimization-jest 73.89% <ø> (+17.86%) ⬆️
test-optimization-mocha 74.31% <ø> (+20.57%) ⬆️
test-optimization-playwright-playwright-atr 61.57% <ø> (+18.37%) ⬆️
test-optimization-playwright-playwright-efd 61.76% <ø> (+18.28%) ⬆️
test-optimization-playwright-playwright-final-status 61.72% <ø> (+18.12%) ⬆️
test-optimization-playwright-playwright-impacted-tests 61.44% <ø> (+18.32%) ⬆️
test-optimization-playwright-playwright-reporting 61.51% <ø> (+18.36%) ⬆️
test-optimization-playwright-playwright-test-management 62.25% <ø> (+17.66%) ⬆️
test-optimization-playwright-playwright-test-span 61.49% <ø> (+17.09%) ⬆️
test-optimization-selenium 60.68% <ø> (+15.66%) ⬆️
test-optimization-testopt 59.14% <ø> (+12.86%) ⬆️
test-optimization-vitest 72.74% <ø> (+20.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

BridgeAR added 6 commits June 27, 2026 16:58
…f istanbul

The integration coverage harness instrumented dd-trace's source to count lines:
nyc's require-hook in every spawned child, plus a pack-time istanbul rewrite of
the sandbox tarball. That transform is the dominant cost of a coverage run
(~4x wall time on spawn-heavy suites, enough to time out child_process tests on
slower runners) and it breaks source-map resolution, which is why several
fixtures opt out entirely.

Switch collection to native V8 coverage (c8). Every process in the tree writes a
raw V8 profile into one shared collector directory via NODE_V8_COVERAGE; after
mocha exits, merge-lcov converts each profile through v8-to-istanbul into the
same coverage/node-<version> lcov the upload step already reads. No source is
transformed, so ESM and source-mapped files are covered without a hook.

1. patch-child-process.js now injects NODE_V8_COVERAGE (plus a minimal bootstrap
   require that only re-installs the patch) into children, including those that
   replace env; the opt-out blanks NODE_V8_COVERAGE rather than omitting it,
   because Node copies the parent's value to a child otherwise.
2. child-bootstrap.js drops nyc.wrap()/the pre-instrumented writer and instead
   flushes via v8.takeCoverage() on SIGTERM/SIGINT, so a long-running fixture the
   harness stops with a signal still contributes coverage.
3. The in-process test:*:ci suites move from nyc to c8 via scripts/c8-ci.js.
4. scripts/patch-v8-to-istanbul.js corrects V8's line-coverage over-report on
   multi-line statements: V8 leaves an indented, un-taken ternary/logical arm
   reported as covered, so the patch zeroes a line covered only from its first
   non-whitespace column. This keeps c8's line numbers aligned with the
   statement-granular istanbul baseline Codecov was built against.

Deletes the pack-time instrumenter, the pre-instrumented writer, the sandbox nyc
config, and the per-sandbox finalize step — all of which existed only to get
istanbul counters into child processes.
`v8-to-istanbul` is a c8 transitive pinned at `^9.0.0` in the lockfile; declaring
it as a direct dep at `^9.3.0` left a range the lock had no key for, so every CI
job failed to install with `v8-to-istanbul@^9.3.0 failed to resolve`. Align the
declared range with the existing resolution (9.3.0 satisfies both).
…e c8 CLI

c8's bundled yargs entrypoint throws `require is not defined in ES module scope`
when its bin loads under newer Node, so every `test:*:ci` job died at startup.
Drop the c8 CLI from scripts/c8-ci.js and instead set NODE_V8_COVERAGE directly,
then convert the profiles with the same patched v8-to-istanbul pipeline the
integration harness uses (extracted as `convertV8DirToReport` from merge-lcov).
Both coverage paths now report through one code path with no CLI dependency.
… chains

The `:ci` scripts now invoke `node scripts/c8-ci.js <script>` instead of
`nyc -- npm run <script>`. verify-exercised-tests.js only followed `npm run` /
`yarn` chains, so it could no longer trace a `:ci` script to the glob that
selects its specs and reported every in-process suite's tests as unexercised.
Recognize `node scripts/c8-ci.js <script>` as equivalent to `npm run <script>`.
…verage

The coverage harness self-test runs in the integration-tests suite, which the
Platform job executes via `test:integration:coverage` — i.e. inside the very
harness it tests. The ambient NODE_V8_COVERAGE then redirects the children these
cases spawn, so a test asserting on its own explicit coverage directory found
nothing. Read coverage from whichever directory actually received the profile
(the ambient collector when active, the explicit dir otherwise), exercise the
shared `convertV8DirToReport` directly instead of the shared merge output dir,
and assert the report/`.skipped` invariant rather than a specific source file
that the harness legitimately excludes.
Integration tests install dd-trace as a packed tarball inside a throwaway
sandbox and run against it, so V8 records coverage under
`<sandbox>/node_modules/dd-trace/…`. Two things then dropped every one of those
entries at merge time: the sandbox path failed the REPO_ROOT/`node_modules`
include check, and the sandbox is deleted before the merge runs so the file is
no longer loadable. All dd-trace code exercised only from sandboxes — the jest,
cypress, playwright and vitest plugins, the profiler CLI — therefore reported
zero coverage, which the previous istanbul harness had captured by rebasing
sandbox paths back onto the repo tree.

Map the segment after `node_modules/dd-trace/` onto REPO_ROOT before the include
check, and load the still-present repo copy (whose bytes are identical to the
sandbox copy V8 measured, the tarball shipping source verbatim) so the entry is
counted under its repo path and merges with in-process coverage.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-06-26-c8-native-coverage branch from ed7b908 to 7f8f64b Compare June 27, 2026 15:39
BridgeAR added 2 commits June 27, 2026 18:04
The codeowners audit only scoped `**/*.spec.js`, `benchmark/sirun/**`, and the
agent config dirs, so every non-spec file under integration-tests/ — fixtures,
helpers, forwarder scripts — could land unowned without tripping the lint gate.
The new coverage-merge-lcov.spec.js was the first to surface it.

Add an `integration-tests/**` glob to the audit and assign every path it flags:
the appsec graphql and standalone-asm fixtures to asm-js, the pino fixture to
apm-idm-js, the log_injection / remote_config fixtures and telemetry forwarder
to apm-sdk-capabilities-js, and the shared helpers, init, memory-leak,
package-guardrails, startup and tsconfig entries to lang-platform-js. The
package-guardrails directory entry replaces the file-by-file flush.js rule the
audit flagged as fragile.
The project status was off, so a PR could land changed lines at the 95% patch
target while quietly lowering total coverage with no gate to stop it. Turn the
project status back on with `target: auto` and `threshold: 0%` so any drop below
the PR's base fails `codecov/project`, while patch stays at 95% — new code may
sit at 95% as long as it does not pull the overall number down. It keeps the
existing `master-coverage` flag / only_pulls scoping, so non-master PRs auto-pass.

Also bump both All Green upload fan-outs (Datadog and Codecov) from -P 10 to
-P 20. The upload step is still a noticeable chunk of that job and the earlier
parallelism bump held up, so this raises it further to see if it shortens the
step without overwhelming either backend.
@BridgeAR
BridgeAR marked this pull request as ready for review June 27, 2026 16:32
@BridgeAR
BridgeAR requested review from a team as code owners June 27, 2026 16:32
@BridgeAR
BridgeAR requested review from khanayan123 and removed request for a team June 27, 2026 16:32
sabrenner
sabrenner previously approved these changes Jul 6, 2026

@sabrenner sabrenner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two non-blocking questions, gave it a general look over but afaict looks ok to me

Comment thread integration-tests/helpers/index.js
Comment thread integration-tests/coverage/runtime.js Outdated
`NODE_V8_COVERAGE` is not private to the harness — Node's own test runner
(`node --test --experimental-test-coverage`), c8 and other tools read it from
the child env. Overwriting it unconditionally redirected such a fixture's own
coverage into our collector, usually leaving its assertions green against empty
data. When a child already carries a directory, leave it in place and record the
collector in a copy-back marker instead; the per-spawn opt-out likewise blanks
`NODE_V8_COVERAGE` only when it is the value the harness injected, preserving a
directory the child set for itself.

A forked child's own profile is folded into the collector on its `exit`, after
V8's single teardown write, so `v8.takeCoverage()` is never called in a
gracefully-exiting child — calling it splits the child's execution counters
(each call resets them), which would corrupt the very coverage the child's own
tooling reads. The forceful stop paths still flush in-child, where the reset is
moot because the process is being terminated.

Reintroduce the Windows IPC flush sentinel in `stopProc`/`child-bootstrap`:
Windows SIGTERM is forceful and skips the signal hook, so a connected child is
asked to flush and exit cleanly on the sentinel, and its preserved-directory
profiles are copied on the ensuing exit.

@bengl bengl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but let's make sure all of this patching of devDeps actually happens upstream at some point, in some way.

@bengl bengl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but let's make sure all of this patching of devDeps actually happens upstream at some point, in some way.

@BridgeAR
BridgeAR merged commit 8df3778 into master Jul 7, 2026
655 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-06-26-c8-native-coverage branch July 7, 2026 17:19
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 7, 2026
…f istanbul (#9091)

The istanbul harness made coverage runs spend most of their time rewriting source and installing require hooks in child processes, which timed out spawn-heavy suites and made source-mapped fixtures opt out of coverage entirely.

1. Replace the integration and in-process coverage paths with shared NODE_V8_COVERAGE collection and v8-to-istanbul conversion.
2. Preserve a child's own NODE_V8_COVERAGE directory and copy those profiles back so fixture-level coverage tools keep seeing their own data.
3. Rebase sandbox dd-trace paths onto the repo copy before merging, so packed-tarball integration tests still count toward repo coverage.
4. Patch V8's multi-line line coverage over-reporting to keep Codecov line numbers aligned with the istanbul baseline.
5. Restore coverage CI guardrails by enabling project coverage drops as failures and auditing integration-test ownership.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 7, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Jul 7, 2026
…f istanbul (#9091)

The istanbul harness made coverage runs spend most of their time rewriting source and installing require hooks in child processes, which timed out spawn-heavy suites and made source-mapped fixtures opt out of coverage entirely.

1. Replace the integration and in-process coverage paths with shared NODE_V8_COVERAGE collection and v8-to-istanbul conversion.
2. Preserve a child's own NODE_V8_COVERAGE directory and copy those profiles back so fixture-level coverage tools keep seeing their own data.
3. Rebase sandbox dd-trace paths onto the repo copy before merging, so packed-tarball integration tests still count toward repo coverage.
4. Patch V8's multi-line line coverage over-reporting to keep Codecov line numbers aligned with the istanbul baseline.
5. Restore coverage CI guardrails by enabling project coverage drops as failures and auditing integration-test ownership.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jul 7, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 8, 2026
…f istanbul (#9091)

The istanbul harness made coverage runs spend most of their time rewriting source and installing require hooks in child processes, which timed out spawn-heavy suites and made source-mapped fixtures opt out of coverage entirely.

1. Replace the integration and in-process coverage paths with shared NODE_V8_COVERAGE collection and v8-to-istanbul conversion.
2. Preserve a child's own NODE_V8_COVERAGE directory and copy those profiles back so fixture-level coverage tools keep seeing their own data.
3. Rebase sandbox dd-trace paths onto the repo copy before merging, so packed-tarball integration tests still count toward repo coverage.
4. Patch V8's multi-line line coverage over-reporting to keep Codecov line numbers aligned with the istanbul baseline.
5. Restore coverage CI guardrails by enabling project coverage drops as failures and auditing integration-test ownership.
juan-fernandez pushed a commit that referenced this pull request Jul 8, 2026
…f istanbul (#9091)

The istanbul harness made coverage runs spend most of their time rewriting source and installing require hooks in child processes, which timed out spawn-heavy suites and made source-mapped fixtures opt out of coverage entirely.

1. Replace the integration and in-process coverage paths with shared NODE_V8_COVERAGE collection and v8-to-istanbul conversion.
2. Preserve a child's own NODE_V8_COVERAGE directory and copy those profiles back so fixture-level coverage tools keep seeing their own data.
3. Rebase sandbox dd-trace paths onto the repo copy before merging, so packed-tarball integration tests still count toward repo coverage.
4. Patch V8's multi-line line coverage over-reporting to keep Codecov line numbers aligned with the istanbul baseline.
5. Restore coverage CI guardrails by enabling project coverage drops as failures and auditing integration-test ownership.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants