Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How not to display stack-trace in nUnit 2.6.4 xml results?

Tags:

c#

xml

nunit

xsd

I have a nunit test dll that I am running with the console runner, and that has a lot of failing tests with exceptions. The resulting xml file is too large and I think it will be a good idea to avoid writing the stack-trace in the xml output, since in my case it is not at all useful to display, and only write the exception message.

However, this is proving to be a lot more difficult than I expected. I saw these two links, where to find the xsd file that nunit uses and how to customize the xml, but in 2.6.4 the /transform option on the console appears to be deprecated, sigh.

I am not sure how to change the files in my nUnit installation directory, will this affect the output? If anybody has managed to change the xml results output of nUnit, can they please point me in the right direction?

like image 752
SWilliams Avatar asked Jun 24 '15 11:06

SWilliams


1 Answers

Doesn't look possible with nunit as it stands. Had a look around after you mentioned its being used by another tool.

Found This on the nunit discussion board. It says the following:

As you probably know already, NUnit does not have any built-in way to customize the content of the XML file. We will work on that for NUnit 3.0, but for NUnit 2.x, it would be necessary to build a modified copy of NUnit.

The XML result file is created by the XmlResultWriter class, which is part of the nunit.util assembly. See http://bazaar.launchpad.net/~nunit-core/nunitv2/trunk/view/head:/src/ClientUtilities/util/XmlResultWriter.cs

like image 176
krystan honour Avatar answered Nov 14 '22 04:11

krystan honour