Repository navigation
Use product targeting pack for analyzer tests and add compatibility tests - #15315
Merged
KlausLoeffelmann merged 2 commits intoOct 27, 2026
Merged
KlausLoeffelmann merged 2 commits into
KlausLoeffelmann merged 2 commits into
Conversation
* Resolve analyzer references from the test runtime configuration, not the bootstrap SDK’s bundled pack. * Add C# and Visual Basic compilation tests to verify compatibility.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new compatibility test requires a WinForms build artifact without declaring the build prerequisite needed for independent clean runs.
1 open issue
What changed in this PR
This PR aligns analyzer-test reference assemblies with the repository’s product targeting pack rather than the bootstrap SDK’s bundled pack.
Changes:
- Resolve the reference-pack version from the analyzer tests’ runtime configuration.
- Remove SDK-version lookup and installed-pack validation.
- Add runtime-configuration checks and C#/Visual Basic compilation compatibility tests.
| File | Description |
|---|---|
| src/System.Windows.Forms.Analyzers/tests/UnitTests/CurrentReferencesTests.cs | Replaces SDK-pack tests with configuration and compilation compatibility checks. |
| src/System.Windows.Forms.Analyzers/tests/UnitTests/CurrentReferences.cs | Uses test runtime metadata to select the product reference pack from NuGet. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15315 +/- ##
=============================================
Coverage 37.84861% 37.84861%
=============================================
Files 246 246
Lines 9789 9789
Branches 1031 1031
=============================================
Hits 3705 3705
Misses 5920 5920
Partials 164 164
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
LeafShi1
reviewed
Oct 27, 2026
Member
|
Please resolve the copilot submission comment. |
Declare the WinForms build-only prerequisite for compatibility tests and document product targeting-pack resolution. Co-authored-by: Copilot <[email protected]> Copilot-Session: 0816f1a5-b1f1-49b1-b60a-ca866b564c5b
LeafShi1
approved these changes
Oct 27, 2026
SimonZhao888
approved these changes
Oct 27, 2026
Shyam-Gupta
approved these changes
Oct 27, 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.

This pull request refactors how the analyzer tests resolve and use .NET reference assemblies, simplifying the logic for determining the correct targeting pack and removing now-unnecessary code. The changes ensure that the analyzer tests always use the repository's configured targeting pack, and update the test coverage accordingly.
Reference assembly resolution improvements:
CurrentReferencesto resolve the product's targeting pack directly from the test runtime configuration, removing dependency on the SDK's bundled pack and eliminating logic that searched for or validated the SDK version and available targeting packs. [1] [2] [3] [4]Test updates and enhancements:
General cleanup:
Microsoft Reviewers: Open in CodeFlow