Skip to content

Commit

Permalink
Document ignore exit-code functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Jan 5, 2024
1 parent 614e611 commit 174a45e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/core/testing/unit-testing-mstest-runner-exit-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ The MSTest runner uses known exit codes to communicate test failure or app error
| `10` | The exit code `10` indicates that the test adapter, Testing.Platform Test Framework, MSTest, NUnit, or xUnit, failed to run tests for an infrastructure reason unrelated to the test's self. An example is failing to create a fixture needed by tests. |

To enable verbose logging and troubleshoot issues, see [MSTest runner extensions: Troubleshoot](unit-testing-mstest-runner-extensions.md#troubleshoot).

## Ignoring specific exit codes

MSTest runner is designed to be strict by default but allows for configurability. As such, it is possible for users to decide that some exit codes should be ignored (an exit code of `0` will be returned instead of the original exit code).

You can use the `--ignore-exit-code` command line option or the `TESTINGPLATFORM_EXITCODE_IGNORE` environment variable, that accept a semi-colon separated list of exit codes to ignore (e.g. `--ignore-exit-code 2;3;8`). A common scenario is to consider that test failures should not result in a non-zero exit code (which corresponds to ignoring exit-code `2`).
4 changes: 4 additions & 0 deletions docs/core/testing/unit-testing-mstest-runner-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ Defines the verbosity level when the `--diagnostic` switch is used. The availabl

Prints out a description of how to use the command.

- **`-ignore-exit-code`**

Allows to consider some non-zero exit codes as `0`. For more information, refer to [Ignoring specific exit codes](./unit-testing-mstest-runner-exit-codes.md#ignoring-specific-exit-codes).

- **`--info`**

Displays advanced information about the .NET Test Application such as:
Expand Down

0 comments on commit 174a45e

Please sign in to comment.