Skip to content

Commit

Permalink
Release 1.1.3
Browse files Browse the repository at this point in the history
[no ci]
  • Loading branch information
javiertuya committed Dec 11, 2021
1 parent c67b69f commit 9a61d7b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
13 changes: 9 additions & 4 deletions DotnetTestSplit/DotnetTestSplit.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<InformationalVersion>1.1.2</InformationalVersion>
<InformationalVersion>1.1.3</InformationalVersion>

<PackAsTool>true</PackAsTool>
<ToolCommandName>DotnetTestSplit</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<RepositoryUrl>https://github.com/$(GITHUB_REPOSITORY)</RepositoryUrl>
<Version>1.1.2</Version>
<Version>1.1.3</Version>
<Authors>Javier Tuya</Authors>
<Company>GIIS - University of Oviedo</Company>
<Description>Splits dotnet test trx files into separate junit xml files like those generated by maven surefire report plugin.</Description>
<Description>
Splits dotnet test trx files into separate junit xml files like those generated by maven surefire report plugin.

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.
</Description>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/javiertuya/dotnet-test-split</PackageProjectUrl>
<PackageTags>reporting, mstest, junit, surefire</PackageTags>
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Splits `dotnet test` trx files into separate junit xml files like those generated by maven surefire report plugin.

Can be used to generate html reports using some tools like `junitreport` ant task.
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

Expand All @@ -14,17 +15,17 @@ dotnet test MyProject/MyProject.csproj --logger "trx;LogFileName=../../reports/m

Install as a local or global [.Net Core tool](https://docs.microsoft.com/es-es/dotnet/core/tools/dotnet-tool-install):
```
dotnet tool install NetcoreJunitSplit
dotnet tool install --global DotnetTestSplit
```

Run the `NetcoreJunitSplit` tool, passing the trx file as parameter.
This will place each junit xml report file at the report folder, one file per test class
The below example will place each junit xml report file at the report folder, one file per test class

```
NetcoreJunitSplit reports/mstest-report.trx
NetcoreJunitSplit reports/mstest-report.trx reports
```

If you want generate [junit reports using ant](https://ant.apache.org/manual/Tasks/junitreport.html),
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`:

```
Expand All @@ -37,10 +38,25 @@ the below task will generate the two different views of the html reports in fold
</junitreport>
```

These reports can be exported to some tools, e.g. to exportthe html report with frames to Jenkins :
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
```

0 comments on commit 9a61d7b

Please sign in to comment.