need help troubleshooting nunit reports in teamcity

Hello, my msbuild script is executing my NUnit task.  The build log is showing that nunit console is executing 200+ unit tests, all of which are passing.

However, the statistics view and the overview of the build project only show that 60 tests are being executed.

I think I have something misconfigured.

I am new to TeamCity, I have searched through the online docs, but cant seem to find anything.

Does anone have any pointers that can help me troubleshoot this issue?

6 comments
Comment actions Permalink

It is almost like the report parser is ignoring my the <test-suite> elements.

In nunit i create many tests that are decorated with [TestCase] and [TestCaseSource].

I beleive these result in <test-suite> elements that contain a <test-case> element for each individual test.

Does the report parser deal with <test-suite> elements that have the "type" attribute set to "ParameterizedTest"?

i.e. will the report parser read elements like this....

<test-suite type="ParameterizedTest" name="LogsA_DebugMessage" executed="True" result="Success" success="True" time="0.359" asserts="0">
<results>
<test-case name="Test1.LogsA_DebugMessage(&quot;54c1365e-9bed-4b42-9cb1-cd646996f99c&quot;,&quot;jbloggs&quot;)" executed="True" result="Success" success="True" time="0.163" asserts="1" />
<test-case name="Test1.LogsA_DebugMessage(&quot;54c1365e-9bed-4b42-9cb1-cd646996f99c&quot;,&quot;jbloggs&quot;)" executed="True" result="Success" success="True" time="0.192" asserts="1" />
</results>
</test-suite>

0
Comment actions Permalink

Hello,

Could you please attach or email to teamcity-feedback@jetbrains.com full nunit xml report log.
What version of NUnit was it?

You may attach TeamCity addin for NUnit to make NUnit report tests straint into TeamCity. Take a look at
http://confluence.jetbrains.net/display/TCD65/TeamCity+Addin+for+NUnit

Another approach is to use TeamCity NUnit build runner
http://confluence.jetbrains.net/display/TCD65/NUnit

0
Comment actions Permalink

Thank you for the reply.

I have attached the xml report for the last test run.

Regarding the " TeamCity addin for NUnit " is that installed by default or is it a download.  I totally cannot find the download link to install the plugin.

I have read both of those articles that you referred me to.  I am a total noob to TeamCity.  It is something that Ive inherited, and unfortunately my CI experience is limited to CCNET + MSBUILD or TeamBuild + MSBuild, so I am muffed on how to actually tell my build to use the "TeamCity addin for NUnit " or run the TeamCity NUnit test runner.

Lol, so thats why I am using the NUnit Task for MSBuild.

Oh, I am on v4.5 of TeamCity and v 2.5.5.10112 of NUnit.

Any pointers would be much appreciated.



Attachment(s):
test-results.xml
0
Comment actions Permalink

Hello,

Thank you for nunit report you attached, we check it with latest XmlReporting.

You use really old version of TeamCity. Would you consider upgrading to the latest one (6.5.2)

Please attach a part of MSBuild script where you call NUnit runner.
This is a documentation about NUnitTeamCity of NUnit MSBuild task that TeamCity provides for MSBuild/NUnit integration:
http://confluence.jetbrains.net/display/TCD4/NUnit+for+MSBuild

0
Comment actions Permalink

We checked your NUnit report with latest XmlReporting. It worked well. There were several major issues with NUnit support in XmlReporting fixed after 4.x.

0
Comment actions Permalink

Ok, so here is the msbuild task that we are using to run the tests and generate the test-result.xml report.

We are using the vanilla NUnit task from the MSBuild community.

I will try to replace it with the team city veresion.

I check with our ops manager about upgrading to 6.x.  I also ran some tests in my local environment against 6.x and the tests that I write ARE detected by 6.x so it does what I need it to do.

Here is what our nunit task looks like...

<Target Name="UnitTest">
  <Message Text="Starting Target: UnitTests"/>
  <CreateItem Include="$(SolutionDir)\*.Test\bin\$(Configuration)\*Test.dll">
   <Output TaskParameter="Include" ItemName="TestAssemblies"/>
  </CreateItem>

  <NUnit ToolPath="$(NUnit-ToolPath)"
      Assemblies="@(TestAssemblies)"
      OutputXmlFile="test-results.xml"
      DisableShadowCopy="true" />
</Target>

0

Please sign in to leave a comment.