Fix: Filter forced discovery plan to test location#104
Merged
anmarchenko merged 2 commits intoJul 2, 2026
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 0a6df2b | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
More details
PR correctly filters forced full discovery results through the resolved test location pattern before writing plan artifacts. All tests pass, including a comprehensive regression test validating the three critical scenarios: in-location runnable files are included, in-location skipped files are excluded from the plan, and out-of-location files are excluded. No behavioral regressions or edge-case failures detected.
📊 Validated against 15 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 0a6df2b · What is Autotest? · Any feedback? Reach out in #autotest
juan-fernandez
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Filter full-discovery planner results through the resolved test file selection before writing runnable plan artifacts. This keeps
.testoptimization/runner/test-files.txtandtests-split/runner-*scoped toDD_TEST_OPTIMIZATION_RUNNER_TESTS_LOCATION, even whenDD_TEST_OPTIMIZATION_RUNNER_FORCE_FULL_TEST_DISCOVERY=truemakes discovery observe tests outside that location.Why
Forced full discovery can intentionally scan broadly enough to classify suite-level skips, but the runnable plan artifacts are consumed by CI jobs that are configured for a specific test glob. If full-discovery-only files outside that glob leak into the plan, downstream shards can try to run files from another module or suite and fail to load them.
E2E testing
Run planning with suite-level skipping, forced full discovery, and a narrow test location glob. The regression test covers a runnable file inside the glob, a fully skipped file inside the glob, and a runnable file outside the glob. The expected plan contains only the runnable in-glob file in
runner/test-files.txtand allrunner/tests-split/runner-*files.