Set MSTest.Sdk-wide defaults: UseMSTestSdk, method-level parallelization, Recommended analyzers#54766
Open
Evangelink wants to merge 2 commits into
Open
Set MSTest.Sdk-wide defaults: UseMSTestSdk, method-level parallelization, Recommended analyzers#54766Evangelink wants to merge 2 commits into
Evangelink wants to merge 2 commits into
Conversation
…ion, Recommended analyzers - Set UseMSTestSdk=true globally in Directory.Build.props so Arcade does not implicitly add Microsoft.TestPlatform / MSTest.TestFramework / MSTest.TestAdapter / Microsoft.NET.Test.Sdk PackageReferences (MSTest.Sdk brings them transitively with versions controlled by the SDK). - Default MSTestParallelizeScope=MethodLevel for MSTest.Sdk test projects so MSTest.TestAdapter emits [assembly: Parallelize(Scope = MethodLevel)]. - Default MSTestAnalysisMode=Recommended for MSTest.Sdk test projects. The two MSTest defaults are gated on UsingMSTestSdk=true (the built-in MSTest.Sdk property) so they only apply to MSTest.Sdk projects, not xUnit ones. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the repo’s MSTest.Sdk migration by setting repo-wide MSBuild defaults to better align test project configuration with MSTest.Sdk expectations and reduce per-project boilerplate.
Changes:
- Enable
UseMSTestSdk=trueat the repo level so Arcade doesn’t implicitly add/override MSTest/VSTest package references for MSTest.Sdk projects. - Add MSTest.Sdk-only defaults under
test/for method-level parallelization andRecommendedMSTest analyzer mode.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Sets UseMSTestSdk=true so Arcade defers MSTest dependency/versioning to MSTest.Sdk. |
| test/Directory.Build.props | Adds MSTest.Sdk-gated defaults for parallelization scope and analyzer severity mode. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
…sMode=Recommended Use Assert.IsGreaterThan / IsGreaterThanOrEqualTo / IsLessThan / AreEqual / AreNotEqual / HasCount instead of Assert.IsTrue(x > y) / Assert.AreEqual(.Count). 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.
Continuation of the MSTest.Sdk migration. Sets three repo-wide MSTest.Sdk defaults that were missing after the initial conversion (e.g. #54731, ce24be8, 8c5d462).
Changes
Directory.Build.props—UseMSTestSdk=true(global)Arcade's
Microsoft.DotNet.Arcade.Sdk/tools/MSTest/MSTest.targetsreadsUseMSTestSdkand, whentrue:Microsoft.TestPlatform/MSTest.TestFramework/MSTest.TestAdapterPackageReferences.Microsoft.NET.Test.Sdkfrom test projects.Net effect: MSTest package versions don't need to be declared in
Directory.Packages.props— MSTest.Sdk owns those versions.test/Directory.Build.props— MSTest.Sdk defaults (gated onUsingMSTestSdk==true)<MSTestParallelizeScope>MethodLevel</MSTestParallelizeScope>— MSTest.TestAdapter'sParallelize.targetsemits[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]for every MSTest.Sdk project, so we don't have to author anMSTestSettings.csper project.<MSTestAnalysisMode>Recommended</MSTestAnalysisMode>— promotes info-level MSTest analyzer rules to warnings (and critical rules to errors).Both are gated on the built-in
UsingMSTestSdk(the convention adopted in 8c5d462 / 941324f) so xUnit test projects are not affected.Validation
XML validates. The repo's
.dotnetis not bootstrapped in my local workspace so I did not run a full build — CI will be the truth here.