You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Give more context about dotnet test with mtp (#44618)
* Give more context about dotnet test with mtp
* Update docs/core/testing/unit-testing-platform-integration-dotnet-test.md
---------
Co-authored-by: Bill Wagner <[email protected]>
By default, VSTest is used to run `Microsoft.Testing.Platform`tests. You can enable a full`Microsoft.Testing.Platform` by specifying the `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` setting in your project file. This setting disables VSTest and, thanks to the transitive dependency to the [Microsoft.Testing.Platform.MSBuild](https://nuget.org/packages/Microsoft.Testing.Platform.MSBuild) NuGet package, directly runs all `Microsoft.Testing.Platform` empowered test projects in your solution. It works seamlessly if you pass a direct `Microsoft.Testing.Platform` test project.
33
+
By default, `dotnet test`is using VSTest behavior to run tests. You can enable support for`Microsoft.Testing.Platform`in `dotnet test`by specifying the `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` setting in your project file.
34
34
35
35
```xml
36
36
<ProjectSdk="Microsoft.NET.Sdk">
@@ -56,7 +56,33 @@ By default, VSTest is used to run `Microsoft.Testing.Platform` tests. You can en
56
56
</Project>
57
57
```
58
58
59
-
In this mode, you can supply extra parameters that are used to call the testing application in one of the following ways:
59
+
> [!NOTE]
60
+
> It's highly recommended that you set the `TestingPlatformDotnetTestSupport` property in `Directory.Build.props`. That way, you don't have to add it to every test project file, and you don't risk introducing a new project that doesn't set this property and end up with a solution where some projects are VSTest while others are Microsoft.Testing.Platform, which may not work correctly and is unsupported scenario.
61
+
62
+
> [!IMPORTANT]
63
+
> Despite `TestingPlatformDotnetTestSupport` being set to `true`, most of the command line options defined in [dotnet test](../tools/dotnet-test.md) remain VSTest oriented and don't impact `Microsoft.Testing.Platform` based tests. To supply arguments to `Microsoft.Testing.Platform`, you need to use one of the methods described in [Microsoft.Testing.Platform command line arguments with dotnet test](#microsofttestingplatform-command-line-arguments-with-dotnet-test).
64
+
65
+
The list below described all `dotnet test` command line options that are supported by `Microsoft.Testing.Platform`:
66
+
67
+
-`-a|--arch <ARCHITECTURE>`
68
+
-`--artifacts-path <ARTIFACTS_DIR>`
69
+
-`-c|--configuration <CONFIGURATION>`
70
+
-`-f|--framework <FRAMEWORK>`
71
+
-`-e|--environment <NAME="VALUE">`
72
+
-`--interactive`
73
+
-`--no-build`
74
+
-`--nologo`
75
+
-`--no-restore`
76
+
-`-o|--output <OUTPUT_DIRECTORY>`
77
+
-`--os <OS>`
78
+
-`-r|--runtime <RUNTIME_IDENTIFIER>`
79
+
-`-v|--verbosity <LEVEL>`
80
+
81
+
These arguments are supported because they are linked to the build step and are independent of the testing platform used.
82
+
83
+
### `Microsoft.Testing.Platform` command line arguments with `dotnet test`
84
+
85
+
You can supply arguments that are used to call the testing application in one of the following ways:
60
86
61
87
- Beginning with `Microsoft.Testing.Platform` version 1.4 (included with MSTest version 3.6), you can add options after the double dash `--` on the command line:
0 commit comments