feat(test-optimization): diagnose and fix Jest suite skipping#9339
Conversation
Overall package sizeSelf size: 6.77 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 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 |
BenchmarksBenchmark execution time: 2026-07-15 12:27:45 Comparing candidate commit 934be27 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2315 metrics, 43 unstable metrics.
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 934be27 | Docs | Datadog PR Page | Give us feedback! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9339 +/- ##
==========================================
+ Coverage 96.61% 96.64% +0.03%
==========================================
Files 920 923 +3
Lines 122236 122937 +701
Branches 21077 21270 +193
==========================================
+ Hits 118097 118817 +720
+ Misses 4139 4120 -19 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
More details
The PR adds diagnostic logging and a kill switch for coverage-report-upload filtering. Critical scenario validated: when all TIA candidates have missing line coverage and upload is enabled, candidates are correctly filtered and a warning is logged for operator visibility. The kill switch preserves backend authority by default while allowing operators to bypass filtering when needed.
📊 Validated against 15 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 4034003 · What is Autotest? · Any feedback? Reach out in #autotest
BridgeAR
left a comment
There was a problem hiding this comment.
It is a bit difficult to read for me, while I believe the code is fine as is. We might want to add a few more test cases to have all permutations in the tests :)
I changed it from fix to feature due to the added config.
|
Bits Code status: ✅ Done Comment @DataDog to request changes |
54b2523 to
204e19a
Compare
There was a problem hiding this comment.
More details
The PR correctly addresses Jest suite skipping when Jest runs below the repository root by separating suite-matching paths from coverage-backfill paths. Existing tests all pass, and adversarial scenarios confirm the Windows path normalization, environment variable kill-switch, and coverage-filtering counters work as intended. The change introduces diagnostic logging to distinguish empty backend responses, coverage filtering, and path mismatches — key for debugging the reported issue where Jest skipped all suites despite receiving skippable candidates.
📊 Validated against 7 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 204e19a · What is Autotest? · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 204e19a0d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
204e19a to
2302a88
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2302a88b73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2302a88 to
934be27
Compare
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What does this PR do?
Logs counts for skippable candidates received, excluded because line coverage is missing, and retained. It warns when coverage filtering removes every candidate and expands the Jest debug message with discovered, candidate, skipped, and runnable suite counts. The same response summary is logged for HTTP-cache responses without logging test names or the full endpoint payload.
Fixes Jest suite matching when Jest runs below the repository root. Suite identifiers are matched relative to Jest's
rootDir, while coverage backfill continues to use repository-relative paths. Received suite paths are also normalized so historical Windows identifiers containing backslashes remain compatible.Adds
DD_CIVISIBILITY_CODE_COVERAGE_REPORT_UPLOAD_ENABLED=falseas an internal kill switch for the backendcoverage_report_upload_enabledsetting. The default value istrue, which preserves backend authority and does not force-enable upload when the backend disables it.Motivation
A Jest run received a non-empty skippable-suite response but still ran every discovered suite. The client compared repository-relative paths against backend suite identifiers relative to Jest's root using exact string matching. Historical Windows identifiers could additionally contain mixed slash directions.
The diagnostics distinguish an empty backend response, client-side line-coverage filtering, and a suite-path mismatch. The kill switch makes it possible to isolate coverage-report-upload behavior without disabling TIA coverage collection or changing the remote setting.