Skip to content

[test optimization] Allow keeping user coverage configuration even if TIA is enabled#7700

Merged
juan-fernandez merged 8 commits intomasterfrom
juan-fernandez/allow-tia-config-jest-config
Mar 10, 2026
Merged

[test optimization] Allow keeping user coverage configuration even if TIA is enabled#7700
juan-fernandez merged 8 commits intomasterfrom
juan-fernandez/allow-tia-config-jest-config

Conversation

@juan-fernandez
Copy link
Copy Markdown
Collaborator

@juan-fernandez juan-fernandez commented Mar 6, 2026

What does this PR do?

Add DD_TEST_TIA_KEEP_COV_CONFIG support to Jest TIA coverage handling and refines behavior based on whether coverage was enabled by dd-trace or by the user.

Motivation

Users need a way to preserve their Jest coverage configuration during TIA runs, while still allowing dd-trace to optimize coverage work when coverage was only enabled internally.

Additional Notes

Add DD_TEST_TIA_KEEP_COV_CONFIG to supported configurations.
Behavior now:

  • If set to true: only enforce collectCoverage + passWithNoTests.
  • If not set to true: apply coverageReporters: ['none'] and skip _addUntestedFiles only when the user had not already configured jest to run with code coverage.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

Overall package size

Self size: 4.93 MB
Deduped: 5.77 MB
No deduping: 5.77 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@datadog-datadog-prod-us1

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.32%. Comparing base (f7a2217) to head (ff3b784).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7700      +/-   ##
==========================================
+ Coverage   80.24%   80.32%   +0.08%     
==========================================
  Files         739      739              
  Lines       31960    31961       +1     
==========================================
+ Hits        25646    25673      +27     
+ Misses       6314     6288      -26     
Flag Coverage Δ
aiguard-macos 38.97% <100.00%> (-0.10%) ⬇️
aiguard-ubuntu 39.08% <100.00%> (-0.10%) ⬇️
aiguard-windows 38.82% <100.00%> (-0.10%) ⬇️
apm-capabilities-tracing-macos 48.78% <100.00%> (+0.04%) ⬆️
apm-capabilities-tracing-ubuntu 48.82% <100.00%> (+<0.01%) ⬆️
apm-capabilities-tracing-windows 48.51% <100.00%> (-0.05%) ⬇️
apm-integrations-child-process 38.53% <100.00%> (-0.10%) ⬇️
apm-integrations-couchbase-18 37.29% <100.00%> (?)
apm-integrations-couchbase-eol 37.76% <100.00%> (-0.09%) ⬇️
apm-integrations-oracledb 37.74% <100.00%> (-0.09%) ⬇️
appsec-express 55.31% <100.00%> (-0.07%) ⬇️
appsec-fastify 51.64% <100.00%> (-0.07%) ⬇️
appsec-graphql 51.82% <100.00%> (-0.06%) ⬇️
appsec-kafka 44.32% <100.00%> (-0.08%) ⬇️
appsec-ldapjs 44.01% <100.00%> (-0.08%) ⬇️
appsec-lodash 43.67% <100.00%> (-0.08%) ⬇️
appsec-macos 58.32% <100.00%> (-0.07%) ⬇️
appsec-mongodb-core 48.82% <100.00%> (+0.04%) ⬆️
appsec-mongoose 49.49% <100.00%> (-0.08%) ⬇️
appsec-mysql 50.88% <100.00%> (-0.07%) ⬇️
appsec-node-serialize 43.18% <100.00%> (-0.08%) ⬇️
appsec-passport 47.62% <100.00%> (-0.08%) ⬇️
appsec-postgres 50.63% <100.00%> (-0.07%) ⬇️
appsec-sourcing 42.58% <100.00%> (-0.08%) ⬇️
appsec-template 43.35% <100.00%> (-0.08%) ⬇️
appsec-ubuntu 58.40% <100.00%> (-0.07%) ⬇️
appsec-windows 58.19% <100.00%> (-0.05%) ⬇️
instrumentations-instrumentation-bluebird 32.32% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-body-parser 40.47% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-child_process 37.83% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-cookie-parser 34.31% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-express 34.64% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.45% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-express-session 40.10% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-fs 31.93% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-generic-pool 29.70% <ø> (ø)
instrumentations-instrumentation-http 39.82% <100.00%> (?)
instrumentations-instrumentation-knex 32.32% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-mongoose 33.46% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-multer 40.22% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-mysql2 38.29% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-passport 43.99% <100.00%> (-0.08%) ⬇️
instrumentations-instrumentation-passport-http 43.67% <100.00%> (-0.08%) ⬇️
instrumentations-instrumentation-passport-local 44.21% <100.00%> (-0.08%) ⬇️
instrumentations-instrumentation-pg 37.72% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-promise 32.25% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-promise-js 32.26% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-q 32.30% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-url 32.22% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-when 32.27% <100.00%> (-0.10%) ⬇️
llmobs-ai 42.11% <100.00%> (-0.09%) ⬇️
llmobs-anthropic 40.29% <100.00%> (-0.09%) ⬇️
llmobs-bedrock 39.24% <100.00%> (-0.08%) ⬇️
llmobs-google-genai 39.95% <100.00%> (+0.04%) ⬆️
llmobs-langchain 39.88% <100.00%> (-0.07%) ⬇️
llmobs-openai 44.11% <100.00%> (-0.09%) ⬇️
llmobs-vertex-ai 40.01% <100.00%> (-0.09%) ⬇️
platform-core 31.53% <ø> (ø)
platform-esbuild 34.48% <ø> (ø)
platform-instrumentations-misc 45.53% <ø> (ø)
platform-shimmer 37.63% <ø> (ø)
platform-unit-guardrails 32.95% <ø> (ø)
plugins-azure-event-hubs 25.83% <ø> (ø)
plugins-azure-service-bus 25.19% <ø> (ø)
plugins-bullmq 44.02% <100.00%> (+0.01%) ⬆️
plugins-cassandra 37.78% <100.00%> (-0.09%) ⬇️
plugins-cookie 26.89% <ø> (ø)
plugins-cookie-parser 26.67% <ø> (ø)
plugins-crypto 26.79% <ø> (ø)
plugins-dd-trace-api 38.36% <100.00%> (-0.10%) ⬇️
plugins-express-mongo-sanitize 26.82% <ø> (ø)
plugins-express-session 26.63% <ø> (ø)
plugins-fastify 42.21% <100.00%> (-0.09%) ⬇️
plugins-fetch 38.35% <100.00%> (-0.09%) ⬇️
plugins-fs 38.63% <100.00%> (-0.10%) ⬇️
plugins-generic-pool 25.87% <ø> (ø)
plugins-google-cloud-pubsub 45.37% <100.00%> (-0.08%) ⬇️
plugins-grpc 40.92% <100.00%> (-0.09%) ⬇️
plugins-handlebars 26.86% <ø> (ø)
plugins-hapi 40.11% <100.00%> (-0.09%) ⬇️
plugins-hono 40.37% <100.00%> (-0.09%) ⬇️
plugins-ioredis 38.44% <100.00%> (-0.10%) ⬇️
plugins-knex 26.50% <ø> (ø)
plugins-ldapjs 24.36% <ø> (ø)
plugins-light-my-request 26.23% <ø> (ø)
plugins-limitd-client 32.61% <100.00%> (-0.10%) ⬇️
plugins-lodash 25.96% <ø> (ø)
plugins-mariadb 39.50% <100.00%> (-0.10%) ⬇️
plugins-memcached 38.16% <100.00%> (-0.10%) ⬇️
plugins-microgateway-core 39.16% <100.00%> (-0.17%) ⬇️
plugins-moleculer 40.51% <100.00%> (-0.09%) ⬇️
plugins-mongodb 39.18% <100.00%> (-0.09%) ⬇️
plugins-mongodb-core 39.02% <100.00%> (-0.10%) ⬇️
plugins-mongoose 38.87% <100.00%> (-0.09%) ⬇️
plugins-multer 26.63% <ø> (ø)
plugins-mysql 39.18% <100.00%> (-0.10%) ⬇️
plugins-mysql2 39.28% <100.00%> (-0.10%) ⬇️
plugins-node-serialize 26.93% <ø> (ø)
plugins-opensearch 37.61% <100.00%> (-0.09%) ⬇️
plugins-passport-http 26.68% <ø> (ø)
plugins-postgres 35.71% <100.00%> (-0.08%) ⬇️
plugins-process 26.79% <ø> (ø)
plugins-pug 26.89% <ø> (ø)
plugins-redis 38.91% <100.00%> (-0.10%) ⬇️
plugins-router 42.94% <100.00%> (-0.09%) ⬇️
plugins-sequelize 25.47% <ø> (ø)
plugins-test-and-upstream-amqp10 38.48% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-amqplib 43.82% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-apollo 39.02% <100.00%> (-0.08%) ⬇️
plugins-test-and-upstream-avsc 38.69% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-bunyan 33.88% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-connect 40.77% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-graphql 40.15% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-koa 40.35% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-protobufjs 38.92% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-rhea 43.99% <100.00%> (-0.10%) ⬇️
plugins-undici 39.13% <100.00%> (-0.09%) ⬇️
plugins-url 26.79% <ø> (ø)
plugins-valkey 38.10% <100.00%> (-0.10%) ⬇️
plugins-vm 26.79% <ø> (ø)
plugins-winston 34.08% <100.00%> (-0.09%) ⬇️
plugins-ws 41.89% <100.00%> (-0.09%) ⬇️
profiling-macos 39.82% <100.00%> (-0.10%) ⬇️
profiling-ubuntu 39.94% <100.00%> (-0.10%) ⬇️
profiling-windows 41.15% <100.00%> (-0.09%) ⬇️
serverless-azure-functions-client 25.54% <ø> (ø)
serverless-azure-functions-eventhubs 25.54% <ø> (?)
serverless-azure-functions-servicebus 25.54% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 6, 2026

Benchmarks

Benchmark execution time: 2026-03-06 17:36:39

Comparing candidate commit ff3b784 in PR branch juan-fernandez/allow-tia-config-jest-config with baseline commit f7a2217 in branch master.

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

@juan-fernandez juan-fernandez marked this pull request as ready for review March 6, 2026 13:13
@juan-fernandez juan-fernandez requested review from a team as code owners March 6, 2026 13:13
@juan-fernandez juan-fernandez requested review from BridgeAR and removed request for a team March 6, 2026 13:13
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

The new env still needs to be registered in the central registry :)

@juan-fernandez
Copy link
Copy Markdown
Collaborator Author

The new env still needs to be registered in the central registry :)

done in adda8e5

@juan-fernandez juan-fernandez requested a review from BridgeAR March 6, 2026 14:13
@juan-fernandez juan-fernandez requested a review from BridgeAR March 6, 2026 14:39
@juan-fernandez juan-fernandez enabled auto-merge (squash) March 6, 2026 19:17
@juan-fernandez juan-fernandez merged commit 4b126a0 into master Mar 10, 2026
789 checks passed
@juan-fernandez juan-fernandez deleted the juan-fernandez/allow-tia-config-jest-config branch March 10, 2026 08:58
dd-octo-sts bot pushed a commit that referenced this pull request Mar 10, 2026
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