Skip to content

Commit 56c6417

Browse files
Youssef1313gewarrenEvangelink
authored
Doc updates for MSTest (#43786)
Co-authored-by: Genevieve Warren <[email protected]> Co-authored-by: Amaury Levé <[email protected]>
1 parent e5755b4 commit 56c6417

File tree

4 files changed

+64
-17
lines changed

4 files changed

+64
-17
lines changed

docs/core/testing/mstest-analyzers/mstest0021.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ms.author: amauryleve
2222
| **Enabled by default** | No |
2323
| **Default severity** | Info |
2424
| **Introduced in version** | 3.4.0 |
25-
| **Is there a code fix** | No |
25+
| **Is there a code fix** | Yes, starting with 3.7.0 |
2626

2727
## Cause
2828

docs/core/testing/unit-testing-platform-config.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The platform will automatically detect and load the *[appname].testconfig.json*
2929

3030
When using [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild), you can simply create a *testconfig.json* file that will be automatically renamed to *[appname].testconfig.json* and moved to the output directory of the test project.
3131

32+
Starting with Microsoft.Testing.Platform 1.5, you can use the command-line argument `--config-file` to specify the path to the *testconfig.json*. This file takes precedence over the *[appname].testconfig.json* file.
33+
3234
> [!NOTE]
3335
> The *[appname].testconfig.json* file will get overwritten on subsequent builds.
3436
@@ -38,3 +40,7 @@ Environment variables can be used to supply some runtime configuration informati
3840

3941
> [!NOTE]
4042
> Environment variables take precedence over configuration settings in the *testconfig.json* file.
43+
44+
### `TESTINGPLATFORM_UI_LANGUAGE` environment variable
45+
46+
Starting with Microsoft.Testing.Platform 1.5, this environment variable sets the language of the platform for displaying messages and logs using a locale value such as `en-us`. This language takes precedence over the Visual Studio and .NET SDK languages. The supported values are the same as for Visual Studio. For more information, see the section on changing the installer language in the [Visual Studio installation documentation](/visualstudio/install/install-visual-studio).

docs/core/testing/unit-testing-platform-extensions-fakes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ To use the new extension with an existing project, update the existing `Microsof
2525
- </Reference>
2626
+ <PackageReference Include="Microsoft.Testing.Extensions.Fakes" Version="17.11.0-beta.24319.3" />
2727
```
28+
29+
If you are using MSTest.Sdk 3.7 or later, use the `EnableMicrosoftTestingExtensionsFakes` property to enable the extension and don't add the package reference.

docs/core/testing/unit-testing-platform-intro.md

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -183,56 +183,95 @@ To run a test project in CI add one step for each test executable that you wish
183183
184184
The list below described only the platform options. To see the specific options brought by each extension, either refer to the extension documentation page or use the `--help` option.
185185

186+
- **`@`**
187+
188+
Specifies the name of the response file. The response file name must immediately follow the @ character with no white space between the @ character and the response file name.
189+
190+
Options in a response file are interpreted as if they were present at that place in the command line. Each argument in a response file must begin and end on the same line. You cannot use the backslash character (\) to concatenate lines. Using a response file helps for very long commands that might exceed the terminal limits. You can combine a response file with inline command-line arguments. For example:
191+
192+
```console
193+
./TestExecutable.exe @"filter.rsp" --timeout 10s
194+
```
195+
196+
where *filter.rsp* can have the following contents:
197+
198+
```rsp
199+
--filter "A very long filter"
200+
```
201+
202+
Or a single rsp file can be used to specify both timeout and filter as follows:
203+
204+
```console
205+
./TestExecutable.exe @"arguments.rsp"
206+
```
207+
208+
```rsp
209+
--filter "A very long filter"
210+
--timeout 10s
211+
```
212+
213+
- **`--config-file`**
214+
215+
Specifies a [*testconfig.json*](unit-testing-platform-config.md) file.
216+
186217
- **`--diagnostic`**
187218

188-
Enables the diagnostic logging. The default log level is `Trace`. The file is written in the output directory with the following name format, `log_[MMddHHssfff].diag`.
219+
Enables the diagnostic logging. The default log level is `Trace`. The file is written in the output directory with the following name format, `log_[MMddHHssfff].diag`.
189220

190221
- **`--diagnostic-filelogger-synchronouswrite`**
191222

192-
Forces the built-in file logger to synchronously write logs. Useful for scenarios where you don't want to lose any log entries (if the process crashes). This does slow down the test execution.
223+
Forces the built-in file logger to synchronously write logs. Useful for scenarios where you don't want to lose any log entries (if the process crashes). This does slow down the test execution.
193224

194225
- **`--diagnostic-output-directory`**
195226

196-
The output directory of the diagnostic logging, if not specified the file is generated in the default _TestResults_ directory.
227+
The output directory of the diagnostic logging, if not specified the file is generated in the default _TestResults_ directory.
197228

198229
- **`--diagnostic-output-fileprefix`**
199230

200-
The prefix for the log file name. Defaults to `"log_"`.
231+
The prefix for the log file name. Defaults to `"log_"`.
201232

202233
- **`--diagnostic-verbosity`**
203234

204-
Defines the verbosity level when the `--diagnostic` switch is used. The available values are `Trace`, `Debug`, `Information`, `Warning`, `Error`, or `Critical`.
235+
Defines the verbosity level when the `--diagnostic` switch is used. The available values are `Trace`, `Debug`, `Information`, `Warning`, `Error`, or `Critical`.
236+
237+
- **`--exit-on-process-exit`**
238+
239+
Exit the test process if dependent process exits. PID must be provided.
205240

206241
- **`--help`**
207242

208-
Prints out a description of how to use the command.
243+
Prints out a description of how to use the command.
209244

210245
- **`-ignore-exit-code`**
211246

212-
Allows some non-zero exit codes to be ignored, and instead returned as `0`. For more information, see [Ignore specific exit codes](./unit-testing-platform-exit-codes.md#ignore-specific-exit-codes).
247+
Allows some non-zero exit codes to be ignored, and instead returned as `0`. For more information, see [Ignore specific exit codes](./unit-testing-platform-exit-codes.md#ignore-specific-exit-codes).
213248

214249
- **`--info`**
215250

216-
Displays advanced information about the .NET Test Application such as:
251+
Displays advanced information about the .NET Test Application such as:
217252

218-
- The platform.
219-
- The environment.
220-
- Each registered command line provider, such as its, `name`, `version`, `description` and `options`.
221-
- Each registered tool, such as its, `command`, `name`, `version`, `description`, and all command line providers.
253+
- The platform.
254+
- The environment.
255+
- Each registered command line provider, such as its `name`, `version`, `description`, and `options`.
256+
- Each registered tool, such as its `command`, `name`, `version`, `description`, and all command-line providers.
222257

223-
This feature is used to understand extensions that would be registering the same command line option or the changes in available options between multiple versions of an extension (or the platform).
258+
This feature is used to understand extensions that would be registering the same command line option or the changes in available options between multiple versions of an extension (or the platform).
224259

225260
- **`--list-tests`**
226261

227-
List available tests. Tests will not be executed.
262+
List available tests. Tests will not be executed.
228263

229264
- **`--minimum-expected-tests`**
230265

231-
Specifies the minimum number of tests that are expected to run. By default, at least one test is expected to run.
266+
Specifies the minimum number of tests that are expected to run. By default, at least one test is expected to run.
232267

233268
- **`--results-directory`**
234269

235-
The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created. The default is `TestResults` in the directory that contains the test application.
270+
The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created. The default is `TestResults` in the directory that contains the test application.
271+
272+
- **`--timeout`**
273+
274+
A global test execution timeout. Takes one argument as string in the format `<value>[h|m|s]` where `<value>` is float.
236275

237276
## MSBuild integration
238277

0 commit comments

Comments
 (0)