microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 56 forks source link

TestResultsReader XUnit with multiple collection failed #301

Closed attilalaszlo closed 8 years ago

attilalaszlo commented 8 years ago

I set up a Publish Test Results step in VSTS, and would like te read an XUnit generated result XML. If I have only one collection in my assembly then it's working. But it's not if I have multiple collections. I got: 2016-05-06T06:55:41.261Z: [warning]Failed to publish test result for fileundefined: assemblyNode.collection.attributes is not a function

XUnit spec says collection can be 0..*: https://xunit.github.io/docs/format-xml-v2.html

An XML for repro:

<?xml version="1.0" encoding="utf-8"?>
<assemblies>
  <assembly name="Slamby.Tests.dll" environment="64-bit .NET (unknown version) [collection-per-class, parallel (4 threads)]" test-framework="xUnit.net 2.1.0.3179" run-date="2016-05-06" run-time="09:00:34" total="14" passed="14" failed="0" skipped="0" time="1.346" errors="0">
    <errors />
    <collection total="13" passed="13" failed="0" skipped="0" name="Test collection for Slamby.Tests.ParallelServiceTest" time="1.123">
      <test name="Slamby.Tests.ParallelServiceTest.User_can_override_limit_with_valid_value_if_there_is_no_explicit_limit_defined(configValue: -1, userLimit: &quot;2&quot;, parallelLimit: 2)" type="Slamby.Tests.ParallelServiceTest" method="User_can_override_limit_with_valid_value_if_there_is_no_explicit_limit_defined" time="0.7475845" result="Pass" />
    </collection>
    <collection total="1" passed="1" failed="0" skipped="0" name="Test collection for Slamby.Tests.CommonTests" time="0.203">
      <test name="Slamby.Tests.CommonTests.Explicit_dataset_should_store_name" type="Slamby.Tests.CommonTests" method="Explicit_dataset_should_store_name" time="0.2028093" result="Pass" />
    </collection>
  </assembly>
</assemblies>
bryanmacfarlane commented 8 years ago

deprecated. use https://github.com/Microsoft/vsts-agent/blob/master/README.md

attilalaszlo commented 8 years ago

Actually it not depends on the vso-agent, I'm using vsts-agent also (on a linux server), but the VSTS server is the one which can not process the result of the xunit file..

prawalagarwal commented 8 years ago

Hi @attilalaszlo

Are you still facing this issue on the vsts-agent?

attilalaszlo commented 8 years ago

Yes, with the version I'm using now. But that is not the newest one. I will update my vsts-agent to v2.102.1 tomorrow and get back with the answer.

prawalagarwal commented 8 years ago

I tried with the latest vsts agent and the sample file you have provided and it worked. Please confirm. Thanks.