[JIRA] [nunit-plugin] (JENKINS-27906) Fail to read NUnit3 output xml

223 views
Skip to first unread message

flaviu.satmar@bwinparty.com (JIRA)

unread,
Jun 2, 2015, 11:21:01 AM6/2/15
to jenkinsc...@googlegroups.com
Flaviu S commented on Bug JENKINS-27906
 
Re: Fail to read NUnit3 output xml

I also stumbled across the same issue, seems like the test results xml structure has changed a lot in nunit3. I will try to provide a sample from both versions if that helps.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

flaviu.satmar@bwinparty.com (JIRA)

unread,
Jun 3, 2015, 4:43:01 AM6/3/15
to jenkinsc...@googlegroups.com
Flaviu S updated an issue
 
Jenkins / Bug JENKINS-27906
Change By: Flaviu S
Attachment: nunit3_TestResult.xml
Attachment: nunit2_TestResult.xml

flaviu.satmar@bwinparty.com (JIRA)

unread,
Jun 3, 2015, 8:52:01 AM6/3/15
to jenkinsc...@googlegroups.com
Flaviu S commented on Bug JENKINS-27906
 
Re: Fail to read NUnit3 output xml

Found some info about it on the nunit github page: https://github.com/nunit/nunit/wiki/XML-Formats
Also there is a workaround, you can tell nunit3 console test runner to save the test results using the nunit2 xml schema by adding the following option --result:TestResult.xml;format=nunit2

flaviu.satmar@bwinparty.com (JIRA)

unread,
Jun 3, 2015, 8:53:01 AM6/3/15
to jenkinsc...@googlegroups.com
Flaviu S edited a comment on Bug JENKINS-27906

scm_issue_link@java.net (JIRA)

unread,
Jun 5, 2015, 8:00:01 PM6/5/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Bruno P. Kinoshita
Path:
src/test/java/hudson/plugins/nunit/NUnitReportTransformerTest.java
src/test/resources/hudson/plugins/nunit/issue-27906.xml
http://jenkins-ci.org/commit/nunit-plugin/0ca5a2ba4231405b3061925002317914f4c6856d
Log:
JENKINS-27906 Added test case

apgray@java.net (JIRA)

unread,
Jun 7, 2015, 11:03:02 PM6/7/15
to jenkinsc...@googlegroups.com
apgray commented on Bug JENKINS-27906

Thanks for the workaround Flaviu S. That works for now.

brian.reeves@thomsonreuters.com (JIRA)

unread,
Aug 18, 2015, 12:53:02 PM8/18/15
to jenkinsc...@googlegroups.com

The workaround isn't working for us. We're receiving the following error. Is there another workaround?
--result:TestResultt_%BUILD_NUMBER%.xml;format=nunit2

Error message:
System.ArgumentException: Invalid XML output format 'nunit2'
11:50:07 Parameter name: format
11:50:07 at NUnit.Engine.Services.ResultService.GetResultWriter(String format, Object[] args)
11:50:07 at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
11:50:07 at NUnit.ConsoleRunner.ConsoleRunner.Execute()
11:50:07 at NUnit.ConsoleRunner.Program.Main(String[] args)

guson@spray.se (JIRA)

unread,
Oct 23, 2015, 8:57:02 AM10/23/15
to jenkinsc...@googlegroups.com

Hi!
I'm having the same problem with NUnit 3 beta5.
Adding the ;format=nunit2 to the --report parameter, seems to work.

Attachments: [^jenkins-nunit3-error.txt]
Relates to: https://github.com/nunit/nunit/issues/853

guson@spray.se (JIRA)

unread,
Oct 23, 2015, 8:58:02 AM10/23/15
to jenkinsc...@googlegroups.com
Jonas Gunnarsson updated an issue
 
Change By: Jonas Gunnarsson
Attachment: jenkins-nunit3-error.txt

brian.reeves@thomsonreuters.com (JIRA)

unread,
Oct 23, 2015, 10:01:02 AM10/23/15
to jenkinsc...@googlegroups.com
Brian Reeves commented on Bug JENKINS-27906
 
Re: Fail to read NUnit3 output xml

We finally got this to work by putting in quotes.

"--result:TestResult.xml;format=nunit2"

tenwit@yahoo.com (JIRA)

unread,
Feb 17, 2016, 4:16:02 PM2/17/16
to jenkinsc...@googlegroups.com

This is an NUnit3 results file that this plugin does not yet support. There is an XSLT file attached to issue JENKINS-32999 that can be used to transform this file to a JUnit results file.

wilson@mace.systems (JIRA)

unread,
Apr 7, 2016, 7:06:03 AM4/7/16
to jenkinsc...@googlegroups.com

Hi There I am currently having the same issue. I am trying to intergrate Nunit from Windows, appears that the Nuget managers' NUnit version is 3 something. I have tried running

in the build step I use MSBuild to build the project.
I then use a CMD Build with this command

"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" "C:\VisualStudios2015Repo\Mace E-Commerce Development\MACE_eCommerce_MAIN\Mace_E-Commerce_Project\WebUnitTest\bin\Debug\WebUnitTest.dll" /work:"C:\TestWeb" "--result:TestResult.xml;format=nunit2"
cd C:\TestWeb\
cd

I then have a post Build process to publish the result
The result is named TestResult.xml and is found in the C:\TestWeb

I am getting the same error the fixes above have not resolved the issue.

Please could anyone give any pointers

The XML produced from the CMD command is attatched to this ticket Named "TestResult.xml"

Here is the output by Jenkins:

============================================================

Run Settings
WorkDirectory: C:\TestWeb
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.5
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
NumberOfTestWorkers: 4

Test Run Summary
Overall result: Failed
Test Count: 1, Passed: 0, Failed: 1, Inconclusive: 0, Skipped: 0
Failed Tests - Failures: 1, Errors: 0, Invalid: 0
Start time: 2016-04-07 10:38:59Z
End time: 2016-04-07 10:38:59Z
Duration: 0.150 seconds

Results (nunit2) saved as TestResult.xml

C:\Users\wilson.li\.jenkins\jobs\SlaveJobRunner\workspace>cd C:\TestWeb\

C:\TestWeb>cd
C:\TestWeb

C:\TestWeb>exit 0
Recording NUnit tests results
ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:
hudson.util.IOException2: Could not transform the NUnit report. Please report this issue to the plugin author
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:68)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:26)
at hudson.FilePath.act(FilePath.java:990)
at hudson.FilePath.act(FilePath.java:968)
at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:145)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Users/wilson.li/.jenkins/jobs/SlaveJobRunner/workspace/temporary-junit-reports/temp-junit.xml; lineNumber: 2; columnNumber: 3; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:102)
at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:72)
at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:63)
... 13 more
Finished: FAILURE@Mention someone by typing their name...

wilson@mace.systems (JIRA)

unread,
Apr 7, 2016, 7:07:01 AM4/7/16
to jenkinsc...@googlegroups.com
Wilson Li updated an issue
 
Change By: Wilson Li
Attachment: TestResult.xml

wilson@mace.systems (JIRA)

unread,
Apr 7, 2016, 7:09:02 AM4/7/16
to jenkinsc...@googlegroups.com
Wilson Li updated an issue
Change By: Wilson Li
Priority: Minor Major

fikret.abdic@dryield.com (JIRA)

unread,
May 10, 2016, 4:40:02 AM5/10/16
to jenkinsc...@googlegroups.com
Fikret Abdic commented on Bug JENKINS-27906
 
Re: Fail to read NUnit3 output xml

You have to change 2 things to get this working! (Some people forget the second one)

Add this to your build command:
/xml:nunit-result_%BUILD_NUMBER%_%SVN_REVISION%.xml;format=nunit2

And this to the section Post Build under Publish Reports
nunit-result_%BUILD_NUMBER%_%SVN_REVISION%.xml

venky0057@gmail.com (JIRA)

unread,
Aug 2, 2016, 3:33:01 AM8/2/16
to jenkinsc...@googlegroups.com

Croy please let me when can we expect the changes to be submitted related to this.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

tal+jenkins-ci.org@cloudshare.com (JIRA)

unread,
Sep 5, 2016, 11:52:03 AM9/5/16
to jenkinsc...@googlegroups.com

This also affects .NET Core testing, in which the output format cannot be changed to NUnit 2

naicigam@gmail.com (JIRA)

unread,
Sep 28, 2016, 10:44:01 AM9/28/16
to jenkinsc...@googlegroups.com

I am having the same issue with .NET Core testing.

kstewart@ea.com (JIRA)

unread,
Oct 19, 2016, 3:19:02 PM10/19/16
to jenkinsc...@googlegroups.com

I am having this issue as well. Particularly i want to use NUnit 3, rather than converting to nunit 2.

Are there plans to update the plugin to be able to handle NUnit 3 ?

tenwit@yahoo.com (JIRA)

unread,
Oct 19, 2016, 4:27:01 PM10/19/16
to jenkinsc...@googlegroups.com

Until it is updated, you can use the JUnit plugin and the NUnit3-JUnit.xslt file that comes with nunit. You can find it on https://github.com/nunit/nunit-transforms/tree/master/nunit3-junit

yfrindel@yahoo.fr (JIRA)

unread,
Dec 2, 2016, 2:30:03 AM12/2/16
to jenkinsc...@googlegroups.com

same issue. Until it is fixed, I transform my results in a nunit2 xml result file.
But with this solution I have less information in my xml file...

yfrindel@yahoo.fr (JIRA)

unread,
Dec 2, 2016, 2:31:02 AM12/2/16
to jenkinsc...@googlegroups.com
Yannick FRINDEL edited a comment on Bug JENKINS-27906
same issue. Until it is fixed, the only solution I have consist to transform my results in a nunit2 xml result file.

But with this solution I have less information in my xml file...

andrew.paul.gray@gmail.com (JIRA)

unread,
Jan 10, 2017, 8:07:05 PM1/10/17
to jenkinsc...@googlegroups.com
Andrew Gray updated an issue
 
Change By: Andrew Gray
Priority: Major Critical

andrew.paul.gray@gmail.com (JIRA)

unread,
Jan 10, 2017, 8:08:02 PM1/10/17
to jenkinsc...@googlegroups.com
Andrew Gray commented on Bug JENKINS-27906
 
Re: Fail to read NUnit3 output xml

This really is a Critical issue. It causes downstream issues with new tools that take NUnit 3 XML as input.

tenwit@yahoo.com (JIRA)

unread,
Jan 10, 2017, 8:20:03 PM1/10/17
to jenkinsc...@googlegroups.com

The plugin is current NUnit2 only. This is a request for a new feature, not a bug. The plugin doesn't claim to support NUnit 3 yet.
Until it does, you can use the the XSLT transform to convert your NUNit3 xml to JUnit xml, which Jenkins can handle. I don't think there's any loss of information doing this (at least, I haven't noticed any).

tenwit@yahoo.com (JIRA)

unread,
Jan 10, 2017, 8:20:09 PM1/10/17
to jenkinsc...@googlegroups.com
Paul Hicks edited a comment on Bug JENKINS-27906
The plugin is current currently NUnit2 only. This is a request for a new feature, not a bug. The plugin doesn't claim to support NUnit 3 yet.

Until it does, you can use the the XSLT transform to convert your NUNit3 xml to JUnit xml, which Jenkins can handle. I don't think there's any loss of information doing this (at least, I haven't noticed any).

andrew.paul.gray@gmail.com (JIRA)

unread,
Jan 10, 2017, 10:54:05 PM1/10/17
to jenkinsc...@googlegroups.com

Hi Paul, Thanks for the link. I disagee with your reasoning though. The plugin may have been written when NUnit 2 was current but it should evolve to handle NUnit3, 4 , 5 etc. It is a bug that is doesn't currently support it.

andrew.paul.gray@gmail.com (JIRA)

unread,
Jan 10, 2017, 11:30:05 PM1/10/17
to jenkinsc...@googlegroups.com
Andrew Gray edited a comment on Bug JENKINS-27906
Message received from Charlie Poole (lead developer of NUnit):

"To add a bit to your concerns, NUnit 3.6 for the first time produces
outcomes that can't be translated to the NUnit 2 format. Warnings
simply won't appear and multiple assert failures, while showing a
consolidated message, won't show separate stack traces for each error.
There's no way for this information to be reproduced in the NUnit 2
format, so we haven't tried.

I think we can predict that coming releases will add other features
that can't be represented in the legacy format."

All the more reason Jenkins has to be able to read NUnit3.  We simple have to consign NUnit
2to 2 to the history books!

andrew.paul.gray@gmail.com (JIRA)

unread,
Jan 10, 2017, 11:30:05 PM1/10/17
to jenkinsc...@googlegroups.com

Message received from Charlie Poole (lead developer of NUnit):

"To add a bit to your concerns, NUnit 3.6 for the first time produces
outcomes that can't be translated to the NUnit 2 format. Warnings
simply won't appear and multiple assert failures, while showing a
consolidated message, won't show separate stack traces for each error.
There's no way for this information to be reproduced in the NUnit 2
format, so we haven't tried.

I think we can predict that coming releases will add other features
that can't be represented in the legacy format."

All the more reason Jenkins has to be able to read NUnit3. We simple have to consign NUnit 2to the history books!

tenwit@yahoo.com (JIRA)

unread,
Jan 10, 2017, 11:36:01 PM1/10/17
to jenkinsc...@googlegroups.com

Perhaps the bug is that the plugin should be called the NUnit2 plugin.

andrew.paul.gray@gmail.com (JIRA)

unread,
Jan 10, 2017, 11:39:03 PM1/10/17
to jenkinsc...@googlegroups.com
Andrew Gray edited a comment on Bug JENKINS-27906
Message received from Charlie Poole (lead developer of NUnit):

"To add a bit to your concerns, NUnit 3.6 for the first time produces
outcomes that can't be translated to the NUnit 2 format. Warnings
simply won't appear and multiple assert failures, while showing a
consolidated message, won't show separate stack traces for each error.
There's no way for this information to be reproduced in the NUnit 2
format, so we haven't tried.

I think we can predict that coming releases will add other features
that can't be represented in the legacy format."

All the more reason Jenkins has to be able to read NUnit3.  We simple simply have to consign NUnit 2 to the history books!

ryan.hutchison@gmail.com (JIRA)

unread,
Feb 8, 2017, 10:57:02 AM2/8/17
to jenkinsc...@googlegroups.com

the nunit3-junit transform works great - thanks Paul Hicks

Would be nice if this plugin could be updated.

slide.o.mix@gmail.com (JIRA)

unread,
Mar 1, 2017, 1:35:13 PM3/1/17
to jenkinsc...@googlegroups.com
Alex Earl updated an issue
 
Change By: Alex Earl
Attachment: nunit.hpi

slide.o.mix@gmail.com (JIRA)

unread,
Mar 1, 2017, 1:35:18 PM3/1/17
to jenkinsc...@googlegroups.com
Alex Earl commented on Bug JENKINS-27906
 
Re: Fail to read NUnit3 output xml

Please try the attached nunit.hpi if you can and see if it works for nunit3. I don't personally have an nunit3 project I can test.

bdominguez@virtualwaregroup.com (JIRA)

unread,
Mar 21, 2017, 11:21:07 AM3/21/17
to jenkinsc...@googlegroups.com
A B commented on Bug JENKINS-27906

Please, support NUnit 3.

It was released a year and a half ago: https://github.com/nunit/docs/wiki/Release-Notes

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

hugues.massot@deviprop.com (JIRA)

unread,
Mar 24, 2017, 8:48:02 AM3/24/17
to jenkinsc...@googlegroups.com

Hi,

I'm new to Jenkins, NUnit, C#,...but I just wanted to say that your hpi file worked fine for my configuration

Thanks

slide.o.mix@gmail.com (JIRA)

unread,
Mar 24, 2017, 7:59:02 PM3/24/17
to jenkinsc...@googlegroups.com
Alex Earl assigned an issue to Alex Earl
 
Change By: Alex Earl
Assignee: Bruno P. Kinoshita Alex Earl
Reply all
Reply to author
Forward
0 new messages