All Projects → gfoidl → trx2junit

gfoidl / trx2junit

Licence: MIT License
Transforms XML from trx-Testresults to JUnit-Testresults / trx to JUnit XML and the other way round

Programming Languages

C#
18002 projects
shell
77523 projects

Projects that are alternatives of or similar to trx2junit

xspec
XSpec is a unit test and behaviour-driven development (BDD) framework for XSLT, XQuery, and Schematron.
Stars: ✭ 91 (+116.67%)
Mutual labels:  unit-testing, xml
Junit Extensions
JUnit5 extensions library including JUnit5 equivalents of some of the common JUnit4 rules: ExpectedException, TemporaryFolder etc
Stars: ✭ 39 (-7.14%)
Mutual labels:  unit-testing, junit
dummyjdbc
dummyjdbc answers database requests with dummy data to be independent of an existing database.
Stars: ✭ 20 (-52.38%)
Mutual labels:  unit-testing, junit
Junitparser
Parses JUnit/xUnit Result XML files with ease
Stars: ✭ 58 (+38.1%)
Mutual labels:  xml, junit
Truth
Fluent assertions for Java and Android
Stars: ✭ 2,359 (+5516.67%)
Mutual labels:  unit-testing, junit
Xmlunit.net
XMLUnit.NET 2.x
Stars: ✭ 50 (+19.05%)
Mutual labels:  unit-testing, xml
System Rules
A collection of JUnit rules for testing code which uses java.lang.System.
Stars: ✭ 492 (+1071.43%)
Mutual labels:  unit-testing, junit
Xmlunit
XMLUnit for Java 2.x
Stars: ✭ 232 (+452.38%)
Mutual labels:  unit-testing, xml
Spectrum
A BDD-style test runner for Java 8. Inspired by Jasmine, RSpec, and Cucumber.
Stars: ✭ 142 (+238.1%)
Mutual labels:  unit-testing, junit
Test Smells
Test Smells for Android developers
Stars: ✭ 120 (+185.71%)
Mutual labels:  unit-testing, junit
Androidunittest
Save time & clear your unit tests on Android !
Stars: ✭ 205 (+388.1%)
Mutual labels:  unit-testing, junit
EasyUtAndroid
Android unit testing example 全面的android应用单元测试方法及案例
Stars: ✭ 21 (-50%)
Mutual labels:  unit-testing, junit
vscode-odoo-snippets
Develop Odoo modules faster and with no Typing Errors.
Stars: ✭ 20 (-52.38%)
Mutual labels:  xml
JUnitPerf
API performance testing framework built using JUnit
Stars: ✭ 48 (+14.29%)
Mutual labels:  junit
GitHub-Stalker
track your GitHub statistics with Pandas
Stars: ✭ 31 (-26.19%)
Mutual labels:  unit-testing
datamaker
Data generator command-line tool and library. Create JSON, CSV, XML data from templates.
Stars: ✭ 23 (-45.24%)
Mutual labels:  xml
laravel-xml-middleware
A Laravel Middleware to accept XML requests
Stars: ✭ 17 (-59.52%)
Mutual labels:  xml
specdris
A test framework for Idris
Stars: ✭ 55 (+30.95%)
Mutual labels:  unit-testing
video seg
视频片段提取
Stars: ✭ 14 (-66.67%)
Mutual labels:  xml
sitewriter
A rust library to generate sitemaps.
Stars: ✭ 18 (-57.14%)
Mutual labels:  xml
CI NuGet
Build Status NuGet

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

trx to junit

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

Jenkins JUnit

For Jenkins JUnit on the testcase the status-attribute is set. By default 1 is set for success, and 0 for failure. This can be configured via environment varialbes (note: if omitted, the default values will be used):

Status Variable default value
success TRX2JUNIT_JENKINS_TESTCASE_STATUS_SUCCESS 1
failure TRX2JUNIT_JENKINS_TESTCASE_STATUS_FAILURE 0
skipped TRX2JUNIT_JENKINS_TESTCASE_STATUS_SKIPPED not set

junit to trx

With option --junit2trx a conversion from junit to trx can be performed.

If a given xml-file is not a junit-file, a message will be logged to stderr and the exit-code is set to 1. A junit-file is considered valid if it either conforms to junit.xsd or jenkins-junit.xsd.

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 / Supported SDKs

In order to install this tool a .NET SDK must be present. Supported SDKs are:

  • .NET 6.0
  • .NET 5.0
  • .NET Core 3.1

Core functionality as standalone package trx2junit.Core

Starting with v2.0.0 it's possible to use the core functionality as standalone package trx2junit.Core.
The tool (see above) itself is a consumer of that package.

After adding a reference to trx2junit.Core one can use it in "commandline-mode" like

Worker worker         = new();
WorkerOptions options = WorkerOptions.Parse(args);
await worker.RunAsync(options);

or create the WorkerOptions via the constructor, and pass that instance into RunAsync of the worker.

Development channel

To get packages from the development channel use a nuget.config similar to this one:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="gfoidl-public" value="https://pkgs.dev.azure.com/gh-gfoidl/github-Projects/_packaging/gfoidl-public/nuget/v3/index.json" />
    </packageSources>
</configuration>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].