yanlend / trx2junit

Transforms XML from trx-Testresults to JUnit-Testresults / trx to JUnit XML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI Code Coverage NuGet MyGet
CircleCI codecov NuGet MyGet Pre Release

trx2junit (.NET Core global tool)

Helper for converting trx-Testresults (dotnet test --logger "trx") to a JUnit-based XML file.

Can be used for CI-scenarios, like CircleCi or GitLab, where as test results JUnit is expected.

Usage

When installed as .NET Core Global Tool:
trx2junit {trxFile} where trxFile is the path to the trx-file.

You can pass more than one trx file, each will create it's own junit xml file.

# handle two files
$ trx2junit a.trx b.trx
Converting 2 trx file(s) to JUnit-xml...
Converting 'a.trx' to 'a.xml'
Converting 'b.trx' to 'b.xml'
done in 0.1234567 seconds. bye.

# for shells that handle wildcard expansion:
$ trx2junit results/*.trx
Converting 1 trx file(s) to JUnit-xml...
Converting 'example.trx' to 'example.xml'
done in 0.1234567 seconds. bye.

If the shell won't handle wildcard expansion, trx2junit handles the expansion of files in the same directory.

A different location for the JUnit-output can be specified:

# specify different output location
$ trx2junit a.trx --output ../results

# or
$ trx2junit --output results a.trx ../tests/b.trx

Installation

dotnet tool install -g trx2junit

For CI-scenarios execute before usage:

export PATH="$PATH:/root/.dotnet/tools"

Check also the documentation of your CI-system on how to persist the PATH between steps, etc. E.g. in CircleCI you need to run

echo 'export PATH="$PATH:/root/.dotnet/tools"' >> "$BASH_ENV"

Prequisites

.NET Core SDK 2.1 onwards.

About

Transforms XML from trx-Testresults to JUnit-Testresults / trx to JUnit XML

License:MIT License


Languages

Language:C# 82.3%Language:Shell 17.7%