Skip to content

Commit ba097dc

Browse files
committed
docs(nunit): record Rider MTP discovery traps and package 0.0.4
Discover is PE-only on the CLI too; Rider net48 still double-lists native NUnit with no suppression hook.
1 parent 41e9955 commit ba097dc

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

docs/agents/nunit-host-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Host DLL changes: `scripts/build-host.ps1 -Year <year>`. Runner: `dotnet publish
3030

3131
- Do not use `NUnit.Engine` in the host.
3232
- Do not add `NUnit3TestAdapter` or `NUnit.Microsoft.Testing.Platform` to a host-test project.
33-
- Rider always shows **two** `HostSmokeTests` trees (native NUnit + DevTools). Only the second/adapter node runs in-host. Proven settings: **Testing Platform** → enable, **uncheck** “Ignore projects discovered by other providers” (else MTP is invisible because `[Test]` is already claimed). **VSTest** enable adapters, keep project mask `*Tests*` (ProjectReference to our adapter is not enough for Rider to show the VSTest suite). Do not add `executor://DevTools.NUnit.V1/` to the adapter ignore list. Do not add `NUnit3TestAdapter`. Visual Studio does not double-discover this way.
34-
- Test Explorer refresh must not start a host. Discovery is local PE metadata. `HostLaunch=false` still starts a matching-version host on **run** if none is open.
33+
- Rider **MTP + net48**: two `HostSmokeTests` trees (native NUnit PSI + DevTools MTP). Only the MTP/DevTools node runs in-host. **MTP + net8**: one tree (native NUnit does not claim the MTP exe). Visual Studio does not double-discover. There is **no** csproj/attribute/ExecutorUri hook to suppress native NUnit; ricaun’s 1-suite explorer is VSTest + NUnit 3, not a discovery API we are missing. Current Rider Testing Platform UI: enable MTP. The old “Ignore projects discovered by other providers” checkbox may be absent — do not block on it. **VSTest** sample: enable adapters, keep project mask `*Tests*` (ProjectReference alone is not enough). Do not add `executor://DevTools.NUnit.V1/` to the adapter ignore list. Do not add `NUnit3TestAdapter`. Sample `Intentional_failure_for_demo` is an expected `Assert.Fail`. A suite-level `ArgumentException` “same key already added” after running all MTP cases is IDE result merge, not a host failure.
34+
- Test Explorer refresh / `dotnet test --list-tests` / `Runner discover` must not start a host. Discovery is local PE metadata. `HostLaunch=false` still starts a matching-version host on **run** if none is open.
3535
- Autodesk configs flatten host obj/bin. MTP overrides `AppendTargetFrameworkToOutputPath=true` so its three TFMs never share a folder (CS2012 / MSB3713). Do not collapse `TargetFrameworks` on packable projects.
3636
- net48 Test Explorer "could not be discovered": `CreateTestSession` failed to load `Unsafe` 6.0. Package props generate binding redirects and pin Unsafe 6.1.2. Adapter does not hit this because it ILRepacks.
3737
- MTP samples are `OutputType=Exe`. Generation snapshot must treat `.exe` as a managed test assembly and skip `Log/` / `TestResults/` / `*.diag`.

docs/product/nunit-host-testing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ controller ships in that installer. The live CAD host executes the tests.
1010

1111
**Experimental.** Discover / run / progress work end-to-end. `RevitDevTool.NUnit`
1212
(MTP) is published independently of the RevitDevTool installer. Version is
13-
`<Version>` in `source/DevTools.NUnit.Mtp/DevTools.NUnit.Mtp.csproj` (starts at
14-
`0.0.1`). Run `.github/workflows/PublishNUnit.yml` from GitHub Actions to pack
13+
`<Version>` in `source/DevTools.NUnit.Mtp/DevTools.NUnit.Mtp.csproj` (currently
14+
`0.0.4`). Run `.github/workflows/PublishNUnit.yml` from GitHub Actions to pack
1515
and push nuget.org (OIDC Trusted Publishing). VSTest stays in-tree and is not
1616
published.
1717

@@ -31,11 +31,11 @@ VSTest (`DevTools.NUnit.TestAdapter`). Keep them on **separate** test projects.
3131

3232
| Project | Role |
3333
|---------|------|
34-
| `DevTools.NUnit.Core` | `nunit/*` wire contracts, timing, protocol version |
34+
| `DevTools.NUnit.Core` | `nunit/*` wire contracts, timing, protocol version. Out-of-process Runner client (`Client/`, linked into MTP/VSTest, not in the host DLL) |
3535
| `DevTools.NUnit.Host` | Native NUnit runtime in the CAD host |
36-
| `DevTools.NUnit.Runner` | CLI controller: find/launch host pipe, discover/run |
37-
| `DevTools.NUnit.Mtp` | MTP framework (`PackageId=RevitDevTool.NUnit`); proxies to Runner |
38-
| `DevTools.NUnit.TestAdapter` | VSTest adapter; same Runner/Host contract |
36+
| `DevTools.NUnit.Runner` | CLI: PE discover locally; find/launch host pipe only on **run** |
37+
| `DevTools.NUnit.Mtp` | MTP framework (`PackageId=RevitDevTool.NUnit`); PE discover in-process; Runner only on **run** |
38+
| `DevTools.NUnit.TestAdapter` | VSTest adapter; same PE discover + Runner **run** contract |
3939

4040
`RevitDevTool.NUnit` is an independent test-platform package. Consumers set
4141
`HostName` / `HostVersion` / launch timeouts; the package does not read this
@@ -82,8 +82,8 @@ IDE selected-run uses FullName. Runner composes NUnit `TestFilter` XML for the h
8282

8383
## Behavior
8484

85-
- IDE / `dotnet test --list-tests` discovery reads PE metadata locally. It does
86-
**not** start a host process. Runner contacts the host only when tests execute.
85+
- IDE / `dotnet test --list-tests` / `Runner discover` read PE metadata locally.
86+
They do **not** start a host process. Runner contacts the host only on `run`.
8787
- `HostLaunch=false` reuses a running host with the same `HostName` +
8888
`HostVersion` (oldest matching PID; no session picker). If none exists, it
8989
starts one. `HostLaunch=true` starts a new host for that Runner invocation

0 commit comments

Comments
 (0)