Migrate Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests to MSTest.Sdk on MTP - #54862
Merged
Evangelink merged 16 commits intoJun 26, 2026
Merged
Conversation
…n MTP Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…undation' into evangelink/mstest-mtp-blazoraot-tests
Resolves conflicts in StaticWebAssets test files and converts newly merged xUnit-style tests/attributes from main to MSTest: - [Fact] -> [TestMethod]; added [TestClass] (+ [DoNotParallelize] for CWD-mutating MT tests) - [PlatformSpecificFact(TestPlatforms.X)] / [PlatformSpecific(...)] -> [TestMethod] + [OSCondition(...)] - [WindowsOnlyRequiresMSBuildVersion(v)] -> [OSCondition(OperatingSystems.Windows)] + [RequiresMSBuildVersion(v)] Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
1 similar comment
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
…-blazoraot-tests # Conflicts: # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeReferenceStaticWebAssetItemsTest.cs
Evangelink
enabled auto-merge
June 22, 2026 10:10
Three files merged in from main still used xUnit constructs after the project moved to MSTest.Sdk, breaking the build: - GenerateStaticWebAssetsPropsFileMultiThreadingTest - StaticWebAssetsGeneratePackManifestMultiThreadingTest - TypeScriptIntegrationTest Convert [Fact] to [TestMethod], add [TestClass]/[DoNotParallelize], implement the now-abstract RestoreNugetPackagePath, replace the ITestOutputHelper ctor with the parameterless MSTest pattern, and use TestContext.CancellationToken. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 22, 2026
Open
This test file was added on main by dotnet#54704 after this branch migrated Microsoft.NET.Sdk.StaticWebAssets.Tests to MSTest.Sdk, so the merge reintroduced xUnit [Fact] usage that no longer compiles (CS0246 FactAttribute/Fact). Convert it to [TestClass]/[TestMethod] with [DoNotParallelize], matching the sibling MultiThreading tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 22, 2026
Member
Author
|
/ba-g unrelated test issues |
JeremyKuhne
requested changes
Jun 22, 2026
The migration tooling inserted large numbers of blank lines throughout the StaticWebAssets/Blazor test files. Restore the original blank-line layout from main while preserving all migrated content (xUnit->MSTest attribute swaps, usings, [TestClass]). No non-blank content changes; reduces the diff by ~50k spurious lines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…onErrorDetectorTests
A merge with main reintroduced the xUnit [Fact] version of this file while the
Microsoft.DotNet.Cli.Utils.Tests project is MSTest.Sdk, causing CS0246
('Fact' could not be found) and breaking every build leg. Restore the
[TestClass]/[TestMethod] version that exists on main.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The xUnit project disabled parallelization assembly-wide via [assembly: CollectionBehavior(DisableTestParallelization = true)]. The MSTest migration dropped that and inherited the repo-wide MethodLevel default, so methods now run in parallel. These integration tests are not parallel-safe: many methods in a class share a fixed test asset directory (helpers use [CallerMemberName]) and several task tests mutate the process-global current directory via Directory.SetCurrentDirectory, producing file-in-use, file-already-exists, missing-metadata and deleted-cwd (GetCwd) races. Setting MSTestParallelizeScope=None emits [assembly: DoNotParallelize], restoring the original fully-serialized semantics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve conflicts in test files migrated to MSTest. Both main and this branch performed the equivalent xUnit->MSTest migration, so conflicts were limited to whitespace, attribute ordering, and per-test [DoNotParallelize] annotations. This branch fully serializes the StaticWebAssets test assembly via MSTestParallelizeScope=None, making main's granular [DoNotParallelize] attributes redundant, so the branch's versions were kept. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts: # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/CollectStaticWebAssetsToCopyMultiThreadingTest.cs # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/MergeConfigurationPropertiesMultiThreadingTest.cs # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileMultiThreadingTest.cs # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetTaskEnvironmentTests.cs # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackManifestMultiThreadingTest.cs # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest.cs # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/UpdatePackageStaticWebAssetsMultiThreadingTest.cs
nohwnd
approved these changes
Jun 26, 2026
drognanar
approved these changes
Jun 26, 2026
Member
Author
|
/ba-g timeout issue with |
YuliiaKovalova
approved these changes
Jun 26, 2026
JeremyKuhne
approved these changes
Jun 26, 2026
pull Bot
pushed a commit
to sysfce2/dotnet-sdk
that referenced
this pull request
Jun 29, 2026
Migrates the three test projects that still used xUnit (v3) to MSTest.Sdk on Microsoft.Testing.Platform, following the pattern established by the sibling migration PRs (dotnet#54883, dotnet#54862, dotnet#54904): - test/Microsoft.NET.Build.Containers.IntegrationTests - test/TemplateEngine/.../TemplateVerifier.IntegrationTests - test/TemplateEngine/.../TemplateVerifier.UnitTests Verify.XunitV3 blocker (the two TemplateVerifier projects): The TemplateVerifier tool''s VerificationEngine drives snapshot verification through Verify.XunitV3 by default, which resolves the running test from xUnit''s ambient context and fails under MSTest (TestContext.TestMethod is null). Added a pluggable static VerificationEngine.DirectoryVerifier hook (with a NoInlining DefaultVerifyDirectory that keeps the xUnit reference off the default path) so MSTest consumers route directory verification to VerifyMSTest.Verifier.VerifyDirectory. Each migrated project wires this via a ModuleInitializer (VerifyDirectoryInitializer) and marks its snapshot classes [UsesVerify]; tests reference Verify.MSTest instead of Verify.XunitV3. test/TemplateEngine/Directory.Build.props now references Microsoft.NET.TestFramework.MSTest for UsingMSTestSdk projects (and keeps the xUnit framework for the rest), and sets SolutionDir/SolutionName so Verify''s solution auto-discovery does not warn under warnaserror. Containers.IntegrationTests: custom xUnit Docker Fact/Theory attributes became MSTest ConditionBaseAttribute gates (DockerUnavailableCondition, PodmanCliCondition, ContainerdStoreUnavailableCondition, DockerSupportsArchCondition); collection definitions became [DoNotParallelize]; ITestOutputHelper injection became SdkTest.Log; [Fact]/[Theory]/[InlineData] -> [TestMethod]/[DataRow]; assertions ported to MSTest. All three projects build cleanly (0 errors, 0 warnings). Tests were not run as part of this change, matching the sibling migration PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Migrates
Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Testsfrom xUnit to MSTest.Sdk on MTP.Depends on #54845 (foundation) and #54861 (BlazorWebAssembly.Tests) — it link-compiles
WasmPublishIntegrationTestBase/BootJsonData/ServiceWorkerAssertfrom the Blazor tests, so this branch is stacked on that one. Merge after both. Compiles clean locally.