Skip to content

Fix: Filter forced discovery plan to test location#104

Merged
anmarchenko merged 2 commits into
mainfrom
anmarchenko/filter-full-discovery-test-location
Jul 2, 2026
Merged

Fix: Filter forced discovery plan to test location#104
anmarchenko merged 2 commits into
mainfrom
anmarchenko/filter-full-discovery-test-location

Conversation

@anmarchenko

@anmarchenko anmarchenko commented Jul 1, 2026

Copy link
Copy Markdown
Member

What

Filter full-discovery planner results through the resolved test file selection before writing runnable plan artifacts. This keeps .testoptimization/runner/test-files.txt and tests-split/runner-* scoped to DD_TEST_OPTIMIZATION_RUNNER_TESTS_LOCATION, even when DD_TEST_OPTIMIZATION_RUNNER_FORCE_FULL_TEST_DISCOVERY=true makes 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.txt and all runner/tests-split/runner-* files.

@anmarchenko anmarchenko changed the title [codex] Filter forced discovery plan to test location Fix: Filter forced discovery plan to test location Jul 1, 2026
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Jul 1, 2026

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 89.55%
Overall Coverage: 88.12% (-0.05%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0a6df2b | Docs | Datadog PR Page | Give us feedback!

@anmarchenko anmarchenko marked this pull request as ready for review July 2, 2026 09:00
@anmarchenko anmarchenko requested a review from a team as a code owner July 2, 2026 09:00

@datadog-datadog-us1-prod datadog-datadog-us1-prod Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

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.

Was this helpful? React 👍 or 👎

📊 Validated against 15 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 0a6df2b · What is Autotest? · Any feedback? Reach out in #autotest

@anmarchenko anmarchenko merged commit ce99c6a into main Jul 2, 2026
4 checks passed
@anmarchenko anmarchenko deleted the anmarchenko/filter-full-discovery-test-location branch July 2, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants