[SDTEST-3823] Add test discovery cache support#77
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89f0867366
ℹ️ 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".
3990484 to
5448ef8
Compare
This comment has been minimized.
This comment has been minimized.
70cd7cc to
708cf75
Compare
708cf75 to
1d0ffd3
Compare
E2E Test Report: SUCCESSTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Test Environment
Results
Baseline plan remained stable where expected:
Issues FoundNo blocking issues found. One behavior to call out for product review: cache validation is tree-diff based, not ancestry based. A no-common-ancestor orphan branch reused the cache when the effective Minor logging note: cache-hit runs correctly log VerificationDatadog UI verification was not applicable for these runs: this was local Test MethodologyCreated disposable commits and branches in the This E2E test was performed by Shepherd - autonomous QA agent for Datadog Test Optimization |
What
Customers can speed up
ddtest planby restoring a previous discovery cache file and passing it with--test-discovery-cache <path>orDD_TEST_OPTIMIZATION_RUNNER_TEST_DISCOVERY_CACHE=<path>. When the cache is valid, ddtest reuses the previously discovered test list and skips Ruby full test discovery. After a successful full discovery, ddtest refreshes./.testoptimization/tests-discovery/tests.json, so CI can persist that file and feed it back into the next run.Why
If test files did not change, ddtest should not have to discover the same tests again.
E2E testing
Run these scenarios on a Ruby project with TIA enabled and at least one skippable test.
Cache creation and restore path:
ddtest planwithout--test-discovery-cache../.testoptimization/tests-discovery/tests.jsonis created and ends with_ddtest_discovery_cache_metadata.--test-discovery-cache <path>orDD_TEST_OPTIMIZATION_RUNNER_TEST_DISCOVERY_CACHE=<path>.Cache hit:
app/.ddtest planwith the restored cache.Test-root invalidation:
spec/**/*for RSpec ortest/**/*for Minitest.ddtest planwith the restored cache../.testoptimization/tests-discovery/tests.json.Settings and cache safety:
--tests-location,--tests-exclude-pattern, framework, platform, corrupt cache file, missing cache file, or cache whose source commit is unavailable locally.Monorepo scope: