Need help with nunit 3.0 xml output after upgrade from Nunit 2.6.4

1,303 views
Skip to first unread message

Bhupesh Dahal

unread,
Mar 24, 2016, 9:11:51 AM3/24/16
to NUnit Developer List
I upgraded my tests from Specflow 1.9 to 2.0 and nunit 2.6.4 to nunit 3.0. We run all our tests via command line, and use xml generated from Nunit to report testing status in a custom test reporting dashboard. I also generate specflow html report using nunit xml output. 

Issue
1. When i run test using nunit 3.0 xml shows 0 for number of test passed, failed, ignored etc. Can someone help me figure this ?  
2. In nunit 2.6.4 i could name xml as my need, but looks like nunit 3.0 always sets it to TestResults.xml, beside manually updating names, is there a way similar to nunit     2.6.4 that i can set the name of this file ?
3. Even though both test were run using same tags total number does not match, so does total mean different between these 2 version? 

Command line that was being used to execute test in nunint 2.6.4

"C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console-x86.exe" /labels /nologo /nodots /include:bol+smoke /output=TestResultsRegression\SmokeTest\LastTestResults.txt /xml=TestResultsRegression\SmokeTest\LastTestResults.xml /framework=4.0.30319 "BL.dll"

Command line i am using for nunit 3.0 

"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" "BL.dll" --where "cat == bol && cat == smoke" --out=D:\AutomatedTests\TestResultsRegression\SmokeTest\LastTestResults.txt --work=D:\AutomatedTests\TestResultsRegression\SmokeTest\  

Part of XML from nunit 2.6.4
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--This file represents the results of running a test suite-->
<test-results name="D:\AutomatedTests\BL.dll" total="505" errors="0" failures="0" not-run="1" inconclusive="0" ignored="1" skipped="0" invalid="0" date="2016-03-24" time="08:24:06">
  <environment nunit-version="2.6.4.14350" clr-version="2.0.50727.5485" os-version="Microsoft Windows NT 6.1.7601 Service Pack 1" platform="Win32NT" cwd="D:\AutomatedTests" machine-name="PD10" user="automation" user-domain="ABC" />
  <culture-info current-culture="en-US" current-uiculture="en-US" />
  <test-suite type="Assembly" name="D:\AutomatedTests\BL.dll" executed="True" result="Success" success="True" time="118.961" asserts="0">
    <results>

Part of XML from nunit 3.0

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="2" testcasecount="78218" result="Passed" total="78218" passed="0" failed="0" inconclusive="0" skipped="0" asserts="0" engine-version="3.2.0.0" clr-version="4.0.30319.34209" start-time="2016-03-24 12:10:09Z" end-time="2016-03-24 12:12:37Z" duration="147.733461">
  <command-line><![CDATA["C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe"  "BL.dll" --where "cat == bol && cat == smoke" --out=D:\AutomatedTests\TestResultsRegression\SmokeTest\LastTestResults.txt --work=D:\AutomatedTests\TestResultsRegression\SmokeTest\   ]]></command-line>
  <filter>
    <and>
      <cat>bol</cat>
      <cat>smoke</cat>
    </and>
  </filter>
  <test-suite type="Assembly" id="1-88941" name="D:\AutomatedTests\BL.dll" fullname="D:\AutomatedTests\BL.dll" runstate="Runnable" testcasecount="78218" result="Passed" duration="120.187742" total="78218" passed="0" failed="0" inconclusive="0" skipped="0" asserts="0">
    <properties>
      <property name="_PID" value="8212" />
      <property name="_APPDOMAIN" value="test-domain-" />
    </properties>

Charlie Poole

unread,
Mar 24, 2016, 9:34:15 AM3/24/16
to nunit-developer

This list is about the development of NUnit. Questions about using NUnit are best asked on the nunit-discuss list.

Some quick answers:
1. Your command-line says to run tests only if they have both categories. You probably don't have any. Perhaps you meant to use || rather than &&.
2. Look at the --result option.
3. Yes, in 3.0 Explicit tests are counted.
Be sure to review the docs, which explain all these differences and more.

--
You received this message because you are subscribed to the Google Groups "NUnit Developer List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bhupesh Dahal

unread,
Mar 24, 2016, 11:44:45 AM3/24/16
to NUnit Developer List
Thank you! Sorry did not realize there was a different group for discussion. I went through the doc list, i see that i can use --result to generate older version of xml, but i cannot find document that shows how or what to pass to do that. I am looking at 

 
and went through Pages on the right side, but could not find any info on it. 

Rob Prouse

unread,
Mar 24, 2016, 12:15:36 PM3/24/16
to nunit-developer
The documentation and the command line help can be a bit confusing. The help for some options is fairly long, so it is put at the bottom of the web page and the --help output. If you look there, you will see,

Several options that specify processing of XML output take an output specification as a value. A SPEC may take one of the following forms:

--OPTION:filename
--OPTION:filename;format=formatname
--OPTION:filename;transform=xsltfile

The --result option may use any of the following formats:

nunit3 - the native XML format for NUnit 3.0
nunit2 - legacy XML format used by earlier releases of NUnit
--

Rob Prouse

 

I welcome VSRE emails. Learn more at http://vsre.info/

Reply all
Reply to author
Forward
0 new messages