feat(test optimization) Add Test Optimization HTTP cache reader#8860
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: c08f345 | Docs | Datadog PR Page | Give us feedback! |
Overall package sizeSelf size: 6.42 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8860 +/- ##
==========================================
- Coverage 93.69% 92.10% -1.59%
==========================================
Files 889 891 +2
Lines 50864 51161 +297
Branches 11834 11900 +66
==========================================
- Hits 47657 47122 -535
- Misses 3207 4039 +832 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 |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
BenchmarksBenchmark execution time: 2026-06-29 13:22:36 Comparing candidate commit c08f345 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2266 metrics, 20 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37ac880dfd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…d was made. Otherwise, fallback to live behavior.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77f0ecc926
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…malformed settings.json
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbdd212cfc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
P2: Do not mark git upload complete when only settings are cached When skippable_tests.json is absent or malformed, getSkippableSuites() falls back to the live skippable endpoint after waiting on the already-resolved _gitUploadPromise, so no actual git upload happens first: Consider either not resolving |
…timization_cache_reading # Conflicts: # packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c08f34586f
ℹ️ 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".
E2E Test Report: SUCCESSTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Test Environment
Results
Mockdog Runs
Issues FoundNo PR behavior issues found in the local E2E coverage. Test Methodology
This E2E test was performed by Shepherd - autonomous QA agent for Datadog Test Optimization. |
What does this PR do?
Add
dd-trace-jssupport for reading a manifest-based HTTP cache and use it as a cache-first source for the existing Test Optimization request flows.Motivation
During the planning phase,
ddtestperforms the Test Optimization backend calls that language tracers would normally perform during initialization, such as fetching settings, known tests, skippable tests, and test-management data.ddtestcaches the raw HTTP responses under.testoptimization/cache/http(even though env var path specification is supported) and passes the manifest path to worker processes. When those workers launch test processes and the tracer initializes, the tracer can read the cached responses instead of repeating the same backend calls.Additional Notes
This PR only implements the language-side reader.
dd-trace-jsdoes not write the.testoptimization/cache/httpfiles. This is responsibility ofddtestCache discovery currently requires a supported manifest and
settings.jsonto be present. If the cache is unavailable, the tracer keeps the existing live HTTP behavior.Cached files contain raw backend JSON responses. The implementation refactors the existing request modules so cached responses and live HTTP responses use the same parsing/normalization logic.
On a cache hit, the exporter skips the corresponding live Test Optimization backend request:
-
settings.jsonreplaces/api/v2/libraries/tests/services/setting-
known_tests.jsonreplaces/api/v2/ci/libraries/tests-
skippable_tests.jsonreplaces/api/v2/ci/tests/skippable-
test_management.jsonreplaces/api/v2/test/libraries/test-management/testsCached settings are also written to the existing Test Optimization settings handoff cache, so downstream consumers such as
nyccan observe the same normalized settings as they do after a live settings request.When the manifest-backed cache is active, git metadata upload is skipped because the cached planning responses were already produced by
ddtest.Existing event, span, coverage, log, and telemetry export paths are unchanged; this only changes how Test Optimization configuration inputs are loaded.