Skip to content

Migrate Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests to MSTest.Sdk on MTP#54862

Open
Evangelink wants to merge 14 commits into
dotnet:mainfrom
Evangelink:evangelink/mstest-mtp-blazoraot-tests
Open

Migrate Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests to MSTest.Sdk on MTP#54862
Evangelink wants to merge 14 commits into
dotnet:mainfrom
Evangelink:evangelink/mstest-mtp-blazoraot-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Migrates Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests from xUnit to MSTest.Sdk on MTP.

Depends on #54845 (foundation) and #54861 (BlazorWebAssembly.Tests) — it link-compiles WasmPublishIntegrationTestBase / BootJsonData / ServiceWorkerAssert from the Blazor tests, so this branch is stacked on that one. Merge after both. Compiles clean locally.

…n MTP

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 18, 2026 12:56
@Evangelink Evangelink requested a review from a team as a code owner June 18, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Evangelink and others added 2 commits June 18, 2026 16:10
…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>
@Evangelink

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

1 similar comment
@Evangelink

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…-blazoraot-tests

# Conflicts:
#	test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeReferenceStaticWebAssetItemsTest.cs
@Evangelink Evangelink enabled auto-merge June 22, 2026 10:10
Copilot AI and others added 2 commits June 22, 2026 12:41
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>
Evangelink and others added 2 commits June 22, 2026 14:58
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>
@Evangelink

Copy link
Copy Markdown
Member Author

/ba-g unrelated test issues

Evangelink and others added 6 commits June 22, 2026 19:50
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>
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.

4 participants