Fix main build break: convert ToolPackageInstanceTests to MSTest (#54822) - #54954
Merged
dsplaisted merged 1 commit intoJun 24, 2026
Merged
Conversation
ToolPackageInstanceTests.cs (added by dotnet#54822) used the xUnit [Fact] attribute, but Microsoft.DotNet.PackageInstall.Tests was migrated to MSTest.Sdk (dotnet#54822 was validated on a pre-migration base and merged without re-running CI against current main, so the incompatibility wasn't caught). The project no longer references xUnit, so [Fact] fails to compile with CS0246, breaking the build on main. Use [TestClass]/[TestMethod] to match the rest of the (MSTest) test project. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MichaelSimons
approved these changes
Jun 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a build break on main by aligning a newly added test with the project’s MSTest.Sdk migration (the test previously used xUnit’s [Fact], which no longer compiles in this project).
Changes:
- Convert
ToolPackageInstanceTestsfrom xUnit[Fact]to MSTest[TestClass]/[TestMethod].
dsplaisted
disabled auto-merge
June 24, 2026 02:29
Member
Author
|
/ba-g Known failures, most with fixes pending in other PRs |
This was referenced Jun 24, 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.
Summary
Fixes the current
mainbuild break inMicrosoft.DotNet.PackageInstall.Tests.ToolPackageInstanceTests.cs(added by #54822) uses the xUnit[Fact]attribute, but the project was migrated to MSTest.Sdk (Migrate Microsoft.DotNet.PackageInstall.Tests to MSTest.Sdk on MTP) and no longer references xUnit, so[Fact]fails to compile:This converts the test to
[TestClass]/[TestMethod]to match the rest of the (MSTest) test project.Root cause
A stale-base merge race: #54822 was validated on a pre-migration (xUnit) base, the MSTest migration merged in between, and #54822 was squash-merged later without re-running CI against current
main. The change doesn't textually conflict, so no merge conflict surfaced and the incompatibility wasn't caught.