Skip to content

Commit

Permalink
add information on the new Microsoft Test Platform (#1013)
Browse files Browse the repository at this point in the history
* add information on the new Microsoft Test Platform

* add information on the new Microsoft Test Platform

* add information on the new Microsoft Test Platform

* add information on the new Microsoft Test Platform

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* add information on the new Microsoft Test Platform

* Update docs/articles/vs-test-adapter/NUnit-And-Microsoft-Test-Platform.md

Co-authored-by: Sean Killeen <[email protected]>

* Added toc entry

* Added toc entry

* phrasing update

* more

* errant space

* final touches

---------

Co-authored-by: Sean Killeen <[email protected]>
  • Loading branch information
OsirisTerje and SeanKilleen authored Feb 3, 2025
1 parent a29fcc0 commit e0b5d9f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
47 changes: 47 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,47 @@
# NUnit and Microsoft Test Platform

## Overview

Microsoft Test Platform (MTP) is the new platform for testing from Microsoft. Test projects can be run as
executables, as with [NUnitLite](../nunit/running-tests/NUnitLite-Runner.md) currently. There is no longer a test
runner; the executable _is_ the test runner.

It will take time to develop feature parity 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

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 with and without MTP, and you can easily switch between them by setting two 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 property, `EnableNUnitRunner`, 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 (v5) version of the NUnit3TestAdapter, running single tests doesn't work. It will always run all tests.
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
like `dotnet test -- --filter Name=Test1`.
2 changes: 2 additions & 0 deletions docs/articles/vs-test-adapter/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
href: Known-Problems.md
- name: Configuration with runsettings
href: Tips-And-Tricks.md
- name: Microsoft Test Platform (MTP)
href: NUnit-And-Microsoft-Test-Platform.md
- name: Trace And Debug Output
href: Trace-and-Debug.md
- name: Supported Frameworks
Expand Down

0 comments on commit e0b5d9f

Please sign in to comment.