Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javiertuya/dotnet-test-split
Splits dotnet test trx files into separate junit xml files like those generated by maven surefire report plugin. The trx files can be generated from MSTest, NUnit or Xunit.
https://github.com/javiertuya/dotnet-test-split
junit mstest nunit reporting split surefire xunit
Last synced: about 4 hours ago
JSON representation
Splits dotnet test trx files into separate junit xml files like those generated by maven surefire report plugin. The trx files can be generated from MSTest, NUnit or Xunit.
- Host: GitHub
- URL: https://github.com/javiertuya/dotnet-test-split
- Owner: javiertuya
- License: mit
- Created: 2021-12-08T16:11:14.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T18:22:44.000Z (7 months ago)
- Last Synced: 2024-05-02T21:38:55.330Z (7 months ago)
- Topics: junit, mstest, nunit, reporting, split, surefire, xunit
- Language: C#
- Homepage:
- Size: 78.1 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Status](https://github.com/javiertuya/dotnet-test-split/actions/workflows/test.yml/badge.svg)
[![Nuget](https://img.shields.io/nuget/v/DotnetTestSplit)](https://www.nuget.org/packages/DotnetTestSplit/)# dotnet-test-split
Splits `dotnet test` trx files into separate junit xml files like those generated by maven surefire report plugin.
The trx files can be generated from MSTest, NUnit or Xunit.Can be used to generate html reports using some tools like `junitreport` ant task to provide a browsable report of the testcases results
to be exported from your CI environment.## Usage
From the solution folder, run your tests specifying a trx logger, e.g. given the project MyProject a trx report is generated at the reports folder:
```
dotnet test MyProject/MyProject.csproj --logger "trx;LogFileName=../../reports/mstest-report.trx"
```Install as a [.Net Core tool](https://docs.microsoft.com/es-es/dotnet/core/tools/dotnet-tool-install):
```
dotnet tool install --global DotnetTestSplit
```Run the `DotnetTestSplit` tool, passing the trx file as parameter.
The below example will place each junit xml report file at the report folder, one file per test class```
DotnetTestSplit reports/mstest-report.trx reports
```## Generating html reports
You can generate the reports in html format using the [junit report ant task](https://ant.apache.org/manual/Tasks/junitreport.html).
the below task will generate the two different views of the html reports in folders `junit-frames` and `junit-noframes`:```
```
## Publishing html reports from CI
These html reports can be managed by you CI environment:
To publish the html report (with frames) to Jenkins you can include the following statement in your Jenkinsfile:
```
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: false,
reportDir: "reports/junit-frames", reportFiles: 'index.html',
reportName: 'JUnit report with frames'])
```To create an artifact including the html reports using GitHub Actions, you can include the following step in your workflow:
```
- name: Publish test report files
if: always()
uses: actions/upload-artifact@v2
with:
name: Html test reports
path: |
reports/junit-frames
reports/junit-noframes
```