Skip to content

fix(test-runner): add orphaned dependency projects with matching --last-failed tests as independent entries#41745

Closed
Git-Raini wants to merge 2 commits into
microsoft:mainfrom
Git-Raini:fix-39811
Closed

fix(test-runner): add orphaned dependency projects with matching --last-failed tests as independent entries#41745
Git-Raini wants to merge 2 commits into
microsoft:mainfrom
Git-Raini:fix-39811

Conversation

@Git-Raini

Copy link
Copy Markdown
Contributor

Follow-up to #41622 (closed, I cannot reopen it as a non-collaborator) addressing @yury-s review feedback there.

Fixes #39811

The previous approach (#41622) conflated a project's structural dependency role with test filtering by changing the top-level/dependency classification predicate itself, which risked regressing the existing dependencies-always-run-in-full guarantee.

This instead leaves the classification and existing dependency-prepend logic untouched, and adds a distinct step: after --last-failed filtering, any project excluded solely because it is someone else's dependency (and that someone didn't survive filtering) is checked for its own matching tests. If found, it is added as an independent entry point, pulling in its own prerequisites in full - never affecting how already-surviving top-level projects' dependencies are run.

Added a dedicated regression test for the exact scenario flagged in review: a dependency project needed by a surviving top-level project still runs in full under --last-failed, even with no matching failures of its own.

Full context/discussion: #41622 (comment)

Git-Raini added 2 commits July 5, 2026 11:55
…ast-failed

Previously only top-level projects were checked against post-shard
filters like --last-failed before dependency projects got prepended
to the root suite. If the only projects with matching tests were
classified as dependencies (e.g. because another project lists them
in `dependencies`), the top-level projects had no matching tests,
got filtered out entirely, and dependencies never got a chance to
run, producing "No tests found".

Fixes: microsoft#39811
…st-failed tests as independent entries

Addresses review feedback on this PR: the previous approach conflated a
project's structural dependency role with test filtering by changing the
top-level/dependency classification predicate itself, which regressed the
existing "dependencies always run in full" guarantee.

This instead leaves the classification and existing dependency-prepend
logic untouched, and adds a distinct step: after --last-failed filtering,
any project that is excluded solely because it is someone else's
dependency (and that someone didn't survive filtering) is checked for its
own matching tests. If found, it is added as an independent entry point,
pulling in its own prerequisites in full - never affecting how already
surviving top-level projects' dependencies are run.
@Git-Raini

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@dgozman

dgozman commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

I don't think we are ready for the additional complexity this introduces. See this comment. Closing for now.

@dgozman dgozman closed this Jul 15, 2026
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.

[BUG]: --last-failed silently drops all tests when using project dependencies

2 participants