DevExpress/testcafe-reporter-nunit

"Invalid results file" error for nunit reporter occurs in TFS build.

Closed this issue · 4 comments

Hi,
I'm trying to run testcafe test cases in TFS. My build consists from the steps:

  1. Get sources from git
  2. npm install
  3. npm run tests = testcafe firefox:headless src/tests -r spec,nunit:results/nunit-results.xml
  4. Publish Test Results (default TFS job), Test result format = NUnit
    Build runs independently.

Sometimes everything is fine and 4th job can read the file of nunit report.
But sometimes occurs something like this:

2018-04-19T17:11:44.3272760Z ##[warning]Failed to read /home/agent/_work/6/s/results/nunit-results.xml. Error : Root element is missing..
2018-04-19T17:11:44.3331700Z ##[warning]Invalid results file. Make sure the result format of the file '/home/agent/_work/6/s/results/nunit-results.xml' matches 'NUnit' test results format.

Result file: nunit-results.txt. Can you help me?) Maybe some quick fix exists.
BTW: I've used xunit first and I had the same error. But I'm writing here :)

Hi @viraxslot, so the issue with NUnit reporter doesn't appear in each testing session? Sometimes it works, sometimes don't? Is XUnit reporter's behavior also unstable, or it fails every time?

@AndreyBelym yes, right. With NUnit reporter I've received both results: when TFS can parse the result's file and when it can't. I've reviewed my nunit-results.txt and I think I understand the problem.

    </test-suite>
</test-results>
<?xml version="1.0" encoding="UTF-8" ?>
<test-results name="TestCafe Tests" total="37" failures="2" date="2018-4-19"
              time="19:04:52">

There are two results. So I need to delete the previous one. Strange, I thought the reporter delete it by itself.

I've run testcafe with xunit 3 times and always I've got the error:

2018-04-21T10:28:32.9117960Z ##[debug]adjustedPattern: '/home/tfsagent/agent/_work/11/s/results/xunit-results*.xml'
2018-04-21T10:28:32.9151360Z ##[debug]1 matches
2018-04-21T10:28:32.9186870Z ##[debug]1 final results
2018-04-21T10:28:33.2071600Z ##[debug]Reading test results from file '/home/tfsagent/agent/_work/11/s/results/xunit-results.xml'
2018-04-21T10:28:33.6737000Z ##[warning]Atleast for one assembly start time was not obtained due to tag not present or parsing issue, total run duration will now be summation of time taken by each assembly
2018-04-21T10:28:33.6836120Z Obtained XUnit Test Run Start Date: 2018-04-21T10:28:33.6820570Z and Completed Date: 2018-04-21T10:28:33.6820570Z
2018-04-21T10:28:33.6935710Z ##[warning]Invalid results file. Make sure the result format of the file '/home/tfsagent/agent/_work/11/s/results/xunit-results.xml' matches 'XUnit' test results format.
2018-04-21T10:28:33.6982450Z ##[debug]Processed: ##vso[results.publish type=XUnit;mergeResults=false;publishRunAttachments=true;resultFiles=/home/tfsagent/agent/_work/11/s/results/xunit-results.xml;]

xunit-results.txt looks just fine. But I suppose the problem could be with "&quot;" symbol in my test name.
I'll try to rename it.

UPDATE: no, it doesn't help, the same error after renaming.

This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.

We're closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.