This Question is Assumed Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
12 Replies Last post: Apr 12, 2010 11:47 AM by Nikolaj Kaare Nørskov  
SteffenS Newbie 10 posts since
Jun 30, 2008
Currently Being Moderated

Jun 30, 2008 6:12 PM

Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Dear all,

 

is there a way to retrieve the nunit testresult.xml file when using the teamcity nunint task with msbuild?

 

I have teamcity 3.1.1 installed.

 

 

Thanks!

Kirill Maximov JetBrains 2,047 posts since
Aug 23, 2002
Currently Being Moderated
Jul 1, 2008 11:23 AM in response to: SteffenS
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Hi,

 

  Possibly, you need artifact publishing functionality? Please take a look at

  http://www.jetbrains.net/confluence/display/TCD3/Build+Artifact

 

  Kind regards,

  KIR

Eugene Petrenko JetBrains 1,876 posts since
Oct 4, 2004
Currently Being Moderated
Jul 1, 2008 4:52 PM in response to: SteffenS
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Hello,

I have created an issue for that at http://www.jetbrains.net/tracker/issue/TW-5366, please watch/vote for it.

 

As workaround you have to use TeamCity commandline Test runner. It requires the following xml file as parameters:

 

 

 

All results will be created in the folder_RESULTS_XML_OUTPUT_DIR_. File name would be the test name + "-results.xml"

 

To run the tests, please write the following in your msbuild:

<Exec Command="$(teamcity_dotnet_nunitlauncher) @@ PATHTO_FAILE_CONTAINING_THE_XML_" />

 

Thanks!

Eugene Petrenko JetBrains 1,876 posts since
Oct 4, 2004
Currently Being Moderated
Jul 1, 2008 7:01 PM in response to: SteffenS
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Sorry, seems I have just send you broken xml file. Please check weather there is quote (") after ext=".xml  in the line starting with formatter.

David Hauser Newbie 1 posts since
Mar 20, 2009
Currently Being Moderated
Mar 20, 2009 7:18 AM in response to: Eugene Petrenko
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Hi Eugene,

I am trying to do the same thing here but the test.xml file sample doesn't contain any parameters to specify include-category and exclude-category for the nunit tests.  Can you let me know how I might run this using categories?

 

Thanks for your help.

Davy Brion Newbie 10 posts since
Feb 15, 2008
Currently Being Moderated
Jul 11, 2008 11:31 AM in response to: Eugene Petrenko
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

this works, but it seems to generate an output file for each test assembly... is there any way to get one complete testresults.xml file like you normally get with nunit-console?

Eugene Petrenko JetBrains 1,876 posts since
Oct 4, 2004
Currently Being Moderated
Jul 11, 2008 12:07 PM in response to: Davy Brion
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

It is impossible in the current TeamCity version. I have added the issue in our tracker for that issue.

Please watch the issue on that at http://www.jetbrains.net:8888/tracker/issue/TW-5392

 

Thanks!

Davy Brion Newbie 10 posts since
Feb 15, 2008
Currently Being Moderated
Jul 19, 2008 6:57 PM in response to: Eugene Petrenko
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

I've documented a workaround that can be used until TeamCity supports this:

http://davybrion.com/blog/2008/07/using-teamcitys-nunit-support-while-keeping-the-output-around/

Nikolaj Kaare Nørskov Newbie 3 posts since
Mar 25, 2010
Currently Being Moderated
Mar 26, 2010 12:08 PM in response to: Eugene Petrenko
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Found the problem, seems the workaround is not required anymore. 

 

Our original nant nunit2 target was simply setup wrong to produce the xml-file.

 

BR

 

/Nikolaj

 

 

I have been trying to get this work-around up and running with NANT, but have problems getting commandline tool to accept the xml file as input.

 

The line:

<Exec Command="$(teamcity_dotnet_nunitlauncher) @@ PATHTO_FAILE_CONTAINING_THE_XML_" />

 

would become something like:

 

<exec program="$(teamcity_dotnet_nunitlauncher)" commandline="path_to_xml_file"/>

 

But I can't get this to work.

 

- It doesn't seems like the teamcity_dotnet_nunitlauncher can take an xml file as a parameter.

- Can't find arguments for commandline to enable it to write the test results to a file

 

Running the following line works:

<exec program="C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe" commandline="D:\TestSites\TestSite1\code\build\test\TestSuite.dll"/>

 

But as far as I understand from the workaround i need to use extra parameters for it to actually save the xml file.

 

I hope you can help me with this.

 

BR

 

/Nikolaj

Eugene Petrenko JetBrains 1,876 posts since
Oct 4, 2004
Currently Being Moderated
Mar 31, 2010 3:03 PM in response to: Nikolaj Kaare Nørskov
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Please try running NUnit runner without arguments. It will dump all supported parameters.

I believe you can write those parameters using commandline switches.

 

Xml file parameters is not documented and used internally. This xml file format may change in next releases.

Could you please attach a sample xml file to check.

Nikolaj Kaare Nørskov Newbie 3 posts since
Mar 25, 2010
Currently Being Moderated
Apr 12, 2010 11:47 AM in response to: Eugene Petrenko
Re: Retrieve NUnit Result file (xml) when using MSBuild NUnit Task

Sorry for the late return and thanks for the reply.

 

As I tried to comment on my own post I already solved my problem. Turns out the nant target was not correct for producing xml output from NUnit - fixing this solved the problem.

 

Best Regards

 

/Nikolaj

More Like This

  • Retrieving data ...