https://github.com/replaysmike/nunit.extension.testmonitor
Provides realtime test monitoring functionality to NUnit
https://github.com/replaysmike/nunit.extension.testmonitor
csharp nunit nunit3 testing
Last synced: 2 months ago
JSON representation
Provides realtime test monitoring functionality to NUnit
- Host: GitHub
- URL: https://github.com/replaysmike/nunit.extension.testmonitor
- Owner: replaysMike
- License: mit
- Created: 2020-02-12T00:28:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T14:55:41.000Z (over 2 years ago)
- Last Synced: 2025-03-10T15:19:49.255Z (2 months ago)
- Topics: csharp, nunit, nunit3, testing
- Language: C#
- Size: 1.75 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NUnit.Extension.TestMonitor
[](https://www.nuget.org/packages/NUnit.Extension.TestMonitor/)
[](https://www.nuget.org/packages/NUnit.Extension.TestMonitor/)
[](https://ci.appveyor.com/project/MichaelBrown/NUnit.Extension.TestMonitor)
[](https://www.codacy.com/app/replaysMike/NUnit.Extension.TestMonitor?utm_source=github.com&utm_medium=referral&utm_content=replaysMike/NUnit.Extension.TestMonitor&utm_campaign=Badge_Grade)
[](https://www.codacy.com/app/replaysMike/NUnit.Extension.TestMonitor?utm_source=github.com&utm_medium=referral&utm_content=replaysMike/NUnit.Extension.TestMonitor&utm_campaign=Badge_Coverage)Provides realtime test monitoring functionality to NUnit using IPC/Named Pipes, Grpc, log files, or StdOut.
# Installation
Choose which configuration you would like to use: [NUnit-Console](https://github.com/nunit/nunit-console) runner or `dotnet test`. See below for installation/configuration instructions for either way of running tests.
## Configuration
This extension is compatible with both the [NUnit-Console](https://github.com/nunit/nunit-console) runner as well as when using `dotnet test` however they must be configured differently. Keep in mind NUnit-Console runner does not currently support .Net Core testing, if you need that you should use the `dotnet test` configuration.
### NUnit-Console Configuration
If using the [NUnit-Console](https://github.com/nunit/nunit-console) runner you must place the extension inside the `addins/` folder of the installation location of NUnit-Console. [Download](https://github.com/replaysMike/NUnit.Extension.TestMonitor/releases) the latest pre-compiled release. The `addins/` folder of NUnit-Console should already exist in its installation folder, and you should place the extension dll's in it's own folder called `NUnit.Extension.TestMonitor`. Additionally, you must tell NUnit-Console of it's existence by appending to the `nunit.bundle.addins` file with the following contents:
```
addins/NUnit.Extension.TestMonitor/NUnit.Extension.TestMonitor.dll # Include the TestMonitor nUnit extension
```
If you wish to customize the extension with non-default options (such as enabling file based logging) you can edit the settings file which will be located at `addins/NUnit.Extension.TestMonitor/appsettings.json`.To confirm that your extension is recognized, you can check with the console runner using: `nunit3-console.exe --list-extensions`
### Dotnet Test Configuration
If using the `dotnet test` command to run your tests you should add the Nuget package to your test project.
```
PM> Install-Package NUnit.Extension.TestMonitor
```To customize settings for the extension, you can add an `appsettings.json` configuration file to your test project and it will be read by the nuget extension. It should contain the following section in the root of your settings file:
```
{
"TestMonitor": {
// the type of events to emit, can define multiple. Valid options: NamedPipes,Grpc,StdOut,LogFile
"EventEmitType": "Grpc,StdOut,LogFile",
// format of the event data. Valid options: json, xml
"EventFormat": "json",
// full path to save the log to
"EventsLogFile": "C:\\logs\\TestMonitor.log",
// for EventEmitType=StdOut, choose which stream to use. Valid options: StdOut, Trace, Debug, None
"EventOutputStream": "StdOut",
// The timeout (in milliseconds) to wait for a Named Pipe client connection (when using EventEmitType=NamedPipes)
"NamedPipesConnectionTimeoutMilliseconds": 2000,
// grpc port number to send test events to (when using EventEmitType=Grpc)
"Port": 35001,
// specify which launchers the extension will work for. If tests are launched by other launchers, the extension will disable waiting for connections. Default: NUnit.Commander.exe
"SupportedRunnerExe": "NUnit.Commander.exe"
}
}
```# Usage
This plugin offers both an IPC/Named Pipes or Grpc support so that you may display or log tests in real-time via a supported real-time client. Any IPC or Grpc host that can receive the json/xml/binary formatted events can receive test information in real-time for analysis and logging.
It is recommended to use the free [NUnit-Commander](https://github.com/replaysMike/NUnit.Commander) as your real-time monitoring client.