Add ILLink conditional test scope to reduce PR validation time - #55522
Merged
MichaelSimons merged 2 commits intoJul 30, 2026
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
MichaelSimons
force-pushed
the
michaelsimons-il-test-scope
branch
3 times, most recently
from
July 29, 2026 19:29
37a1991 to
622eb8a
Compare
MichaelSimons
marked this pull request as ready for review
July 29, 2026 19:31
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces PR validation time by splitting expensive ILLink trimming tests into a dedicated Microsoft.NET.ILLink.Tests test assembly and wiring it into the conditional test filtering system so those tests only run on PRs that touch trimming-related code (while still running unconditionally on CI).
Changes:
- Add a new
test/Microsoft.NET.ILLink.TestsMSTest project and include shared publish test utilities via linked source to avoid duplication. - Move/update ILLink trimming test classes into the new assembly/namespace and update solution/solution filter inclusion.
- Register an
ILLinkConditionalTestScope, and update documentation and CODEOWNERS accordingly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.NET.ILLink.Tests/Microsoft.NET.ILLink.Tests.csproj | New ILLink-specific test project; links shared PublishTestUtils.cs and embeds Strings.resx for resource assertions. |
| test/Microsoft.NET.ILLink.Tests/GivenThatWeWantToRunILLink.cs | Updates namespace/imports and minor formatting; keeps shared helpers available via PublishTestUtils and local ILLinkTestUtils. |
| test/Microsoft.NET.ILLink.Tests/GivenThatWeWantToRunILLink1b.cs | Updates namespace/imports to use the new ILLink test assembly namespace and helpers. |
| test/Microsoft.NET.ILLink.Tests/GivenThatWeWantToRunILLink2b.cs | Updates namespace/imports to use the new ILLink test assembly namespace and helpers. |
| test/Microsoft.NET.ILLink.Tests/GivenThatWeWantToRunILLink3b.cs | Updates namespace/imports to use the new ILLink test assembly namespace and helpers. |
| test/ConditionalTests.props | Adds the ILLink conditional test scope for PR filtering. |
| src/Tasks/Microsoft.NET.slnf | Adds the new ILLink test project to the Tasks solution filter. |
| sdk.slnx | Adds the new ILLink test project to the main solution. |
| documentation/project-docs/pr-test-filtering.md | Updates guidance text now that ILLink tests are no longer the motivating example for class-level filtering. |
| CODEOWNERS | Updates ownership to cover the new ILLink test project directory. |
mthalman
reviewed
Jul 29, 2026
MichaelSimons
force-pushed
the
michaelsimons-il-test-scope
branch
from
July 29, 2026 22:07
622eb8a to
d1ec222
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 446ca0fe-0b6a-44dc-aeaf-7a70fe16272c
Per reviewer feedback, add the ILLink-unique test assets to the ILLink scope's TriggerPaths so a change to those assets triggers the ILLink test suite on PR builds. Also expand the test assets guidance in pr-test-filtering.md to call out the discovery recipe (search for CopyTestAsset/GetTestAsset string literals) so future agents don't miss them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 446ca0fe-0b6a-44dc-aeaf-7a70fe16272c
MichaelSimons
force-pushed
the
michaelsimons-il-test-scope
branch
from
July 29, 2026 22:22
d1ec222 to
f60dc88
Compare
mthalman
approved these changes
Jul 30, 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.
ILLink trimming tests are among the most expensive in the test suite — each test case invokes a full
dotnet publishwith the ILLink linker. On PRs that don't touch trimming-related code, running them provides no signal and burns significant Helix compute.This PR extracts the ILLink tests from
Microsoft.NET.Publish.Testsinto a dedicatedMicrosoft.NET.ILLink.Testsassembly and registers it as aConditionalTestScope. The scope triggers whensrc/Tasks/Microsoft.NET.Build.Tasks/**or the test assembly itself changes, and runs unconditionally on CI.Based on this PR's validation run, the ILLink test work items consumed about 117 Helix compute minutes across Linux x64, Windows x64, Windows x64 FullFramework, and Mac arm64. This is a reasonable approximation of the compute saved on PRs where this scope is not applicable.
PublishTestUtils.csremains inMicrosoft.NET.Publish.Testsand is linked into the new assembly via<Compile Include>to avoid duplicating shared test data.Related to #55203