Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add information on the new Microsoft Test Platform #1013

Merged
merged 26 commits into from
Feb 3, 2025
Merged
Changes from 14 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
aeccc29
add information on the new Microsoft Test Platform
OsirisTerje Feb 2, 2025
4b6b096
add information on the new Microsoft Test Platform
OsirisTerje Feb 2, 2025
5b0e7f3
add information on the new Microsoft Test Platform
OsirisTerje Feb 2, 2025
a877a72
add information on the new Microsoft Test Platform
OsirisTerje Feb 2, 2025
251b637
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
9e08b0a
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
fe9e0d6
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
42287fb
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
4946ae2
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
045ec8a
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
267a3eb
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
aff5ead
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
f046058
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
820ee7e
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
764b9fc
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
f41ab07
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
9ca59ec
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
62e9cb0
add information on the new Microsoft Test Platform
OsirisTerje Feb 2, 2025
4b53e1e
Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platfor…
OsirisTerje Feb 2, 2025
94bd08c
Added toc entry
OsirisTerje Feb 2, 2025
f63fbd7
Added toc entry
OsirisTerje Feb 2, 2025
0dee0e3
phrasing update
SeanKilleen Feb 3, 2025
a23695b
more
SeanKilleen Feb 3, 2025
ca1ec97
errant space
SeanKilleen Feb 3, 2025
b33ecad
final touches
SeanKilleen Feb 3, 2025
c4228bb
missed an errant space
SeanKilleen Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# NUnit and Microsoft Test Platform

## Overview

Microsoft Test Platform (MTP) is the new platform for testing from Microsoft. The Test Projects can be run as
executables, like we do with [NUnitLite](../nunit/running-tests/NUnitLite-Runner.md). There is no longer a test runner;
the executable **is** the test runner.
OsirisTerje marked this conversation as resolved.
Show resolved Hide resolved

It does take time, however, to develop the same capabilities that we have with NUnit's current system, and there are many historical factors to consider.
But, the NUnit team recognizes that in the meantime, there needs to be a bridge between these two. In NUnit, the NUnit3TestAdapter contains what is
necessary to run the MTP using the same old test runners.

This means we have two modes of MTP operation: either use the new platform but not as an executable, or use it
as an executable too.

## Changing a project to use MTP
OsirisTerje marked this conversation as resolved.
Show resolved Hide resolved

To change a current test project to use MTP, you need to use version 5.0 or greater of the NUnit3TestAdapter.

Note that this version can run both MTP and non-MTP, and you can easily switch between them by setting to project
properties.

In a property group (use the top level one), add the following two properties

```xml
<EnableNUnitRunner>true</EnableNUnitRunner>
<OutputType>Exe</OutputType>
```

The first one enables the MTP. The second enables it to also run as an executable, but it doesn't prevent you from
using it in Test Explorer or through `dotnet test`.


## Information on the Microsoft Test Platform

* [Microsoft Test Platform](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-intro?tabs=dotnetcli)
* [NUnit Samples](https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue1152)
* [Adapter issue for implementing MTP](https://github.com/nunit/nunit3-vs-adapter/issues/1152)

## Known issues

In the current version running single tests don't work. It will always run all tests.
OsirisTerje marked this conversation as resolved.
Show resolved Hide resolved
OsirisTerje marked this conversation as resolved.
Show resolved Hide resolved
See [Adapter Issue 1232](https://github.com/nunit/nunit3-vs-adapter/issues/1232).

This applies to both Test Explorer and `dotnet test`.

As a workaround for the latter, you can filter tests using MTP specific commands
OsirisTerje marked this conversation as resolved.
Show resolved Hide resolved
like `dotnet test -- --filter Name=Test1`.

Loading