Pipeline XUnit.net Test Results

Issue #15836 resolved
Bryant created an issue

Does the current test result "parser" handle .net core XUnit.net "trx" format? If not is there a plan to add such capability?

I have attempted to use a .net core logger for xunit and nunit as well that are outlined here: https://github.com/Faizan2304/LoggerExtensions

Unfortunately they did not work in Bitbucket pipelines.

Any help or direction would be appreciated.

Here is an example of the Nunit output (which appeared close to what is acceptable?):

<?xml version="1.0" encoding="utf-8"?>
<test-run id="2" duration="6.6719999999999979" testcasecount="121" total="121" passed="121" failed="0" skipped="0" result="Passed" start-time="2018-03-13T 23:54:15Z" end-time="2018-03-13T 23:54:18Z">
  <test-suite type="Assembly" name="Tests.dll" fullname="Tests.dll" total="121" passed="121" failed="0" skipped="0" duration="6.672" errors="0" result="Passed">
    <errors />
    <test-suite type="TestFixture" name="Get" fullname="Get" total="5" passed="5" failed="0" skipped="0" result="Passed" duration="0.27699999999999997">
      <test-case name="Get.Should_DoSomething" fullname="Get.Should_DoSomething" result="Passed" duration="0.239" asserts="0" />
      <test-case name="Get.Should_DoSomething" fullname="Get.Should_DoSomething" result="Passed" duration="0.011" asserts="0" />
      <test-case name="Get.Should_DoSomething" fullname="Get.Should_DoSomething" result="Passed" duration="0.013999999999999999" asserts="0" />
      <test-case name="Get.Should_DoSomething" fullname="Get.Should_DoSomething" result="Passed" duration="0.006" asserts="0" />
      <test-case name="Get.Should_DoSomething" fullname="Get.Should_DoSomething" result="Passed" duration="0.0069999999999999993" asserts="0" />
    <test-suite type="TestFixture" name="Update" fullname="Update" total="5" passed="5" failed="0" skipped="0" result="Passed" duration="0.124">
      <test-case name="Update.Should_DoThings" fullname="Update.Should_DoThings" result="Passed" duration="0.09799999999999999" asserts="0" />
      <test-case name="Update.Should_DoThings" fullname="Update.Should_DoThings" result="Passed" duration="0.006" asserts="0" />
      <test-case name="Update.Should_DoThings" fullname="Update.Should_DoThings" result="Passed" duration="0.005" asserts="0" />
      <test-case name="Update.Should_DoThings" fullname="Update.Should_DoThings" result="Passed" duration="0.009" asserts="0" />
      <test-case name="Update.Should_DoThings" fullname="Update.Should_DoThings" result="Passed" duration="0.006" asserts="0" />

Comments (8)

  1. aneita staff
    • changed status to open

    Hi Bryant,

    Thanks for reaching out. Currently, our test reporting feature will only parse XML files that are in the JUnit format. There are slight differences between what we support and the example that you have provided - namely, the hyphens in test-suite and test-case. Is it possible to reconfigure your test runner to output the test results in the expected format?

    We don't have plans to support different file extensions and formats at this point in time, however I'll open this issue to gauge the interest of other users on this request.


  2. Gรผnther Foidl

    A different way is to convert the trx to the junit format. This can be done with the dotnet-tool trx2junit. So the original trx and the converted junit are available -- may be useful if both are needed for further analysis or manual inspection (like in Visual Studio with trx-files).

    Disclaimer: I'm the author trx2junit

  3. Log in to comment