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
Copy file name to clipboardExpand all lines: docs/core/testing/unit-testing-platform-vs-vstest.md
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,3 +52,79 @@ To disable the use of the new protocol in Test Explorer, you can edit your proje
52
52
## Executables
53
53
54
54
VSTest ships multiple executables, notably `vstest.console.exe`, `testhost.exe`, and `datacollector.exe`. However, MSTest is embedded directly into your test project and doesn't ship any other executables. The executable your test project compiles to is used to host all the testing tools and carry out all the tasks needed to run tests.
55
+
56
+
## Migrating from VSTest
57
+
58
+
In addition to the steps specific to your test framework, you need to update your test infrastructure to accommodate to `Microsoft.Testing.Platform`.
59
+
60
+
### `dotnet test`
61
+
62
+
Command line options of `dotnet test` are divided into 2 categories: build related arguments and test related ones.
63
+
64
+
The build related arguments are passed to the `dotnet build` command and as such don't need to be updated for the new platform. Build related arguments are listed below:
65
+
66
+
-`-a|--arch <ARCHITECTURE>`
67
+
-`--artifacts-path <ARTIFACTS_DIR>`
68
+
-`-c|--configuration <CONFIGURATION>`
69
+
-`-f|--framework <FRAMEWORK>`
70
+
-`-e|--environment <NAME="VALUE">`
71
+
-`--interactive`
72
+
-`--no-build`
73
+
-`--nologo`
74
+
-`--no-restore`
75
+
-`-o|--output <OUTPUT_DIRECTORY>`
76
+
-`--os <OS>`
77
+
-`-r|--runtime <RUNTIME_IDENTIFIER>`
78
+
-`-v|--verbosity <LEVEL>`
79
+
80
+
The test related arguments are VSTest specific and so need to be transformed to match the new platform. The following table shows the mapping between the VSTest arguments and the new platform:
81
+
82
+
| VSTest argument | New platform argument |
83
+
|-----------------|-----------------------|
84
+
|`--test-adapter-path <ADAPTER_PATH>`| Not supported |
|`-s\|--settings <SETTINGS_FILE>`| Depends upon the selected test framework |
98
+
|`-t\|--list-tests`|`--list-tests`|
99
+
|`-- <RunSettings arguments>`| Not supported |
100
+
101
+
> [!IMPORTANT]
102
+
> Before specifying any `Microsoft.Testing.Platform`, you need to add `--` to separate the `dotnet test` arguments from the new platform arguments.
103
+
104
+
### `vstest.console.exe`
105
+
106
+
If you are using `vstest.console.exe` directly, we recommend replacing it with the `dotnet test` command.
107
+
108
+
### Test Explorer
109
+
110
+
When using Visual Studio or Visual Studio Code Test Explorer, you might need to enable the support for the new test platform.
111
+
112
+
#### Visual Studio
113
+
114
+
Visual Studio Test Explorer supports the new test platform starting with version 17.14. If you are using an earlier version, you might need to update your Visual Studio to the latest version.
115
+
116
+
#### Visual Studio Code
117
+
118
+
Visual Studio Code Test Explorer supports the new test platform starting with version X.
119
+
120
+
### Azure DevOps
121
+
122
+
When using Azure DevOps tasks, you might need to update your pipeline to use the new test platform.
123
+
124
+
#### VSTest task
125
+
126
+
If you are using the [VSTest task](https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/vstest-v3) in Azure DevOps, you can replace it with the [.NET Core task](https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/dotnet-core-cli-v2).
127
+
128
+
#### .NET Core task
129
+
130
+
If you are using the [.NET Core task](https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/dotnet-core-cli-v2), no changes are needed.
0 commit comments