NUnit - No reports found for paths
Hi,
I don't understand why Teamcity doesn't find any report while the report exists and is valid ???
I run TeamCity Professional 6.5 (build 17795)
Here is the MSBuild message sent to TC:
<Message Text="##teamcity[importData type='nunit' path='d:\temp\$(AppName)\DatabaseTests\results.xml' verbose='true' parseOutOfDate='true']" Importance="high"/>
Here is the NUnit results file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--This file represents the results of running a test suite-->
<test-results name="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\Navigio.nunit" total="1" failures="0" not-run="0" date="2012-01-16" time="09:25:59">
<environment nunit-version="2.4.3.0" clr-version="2.0.50727.3053" os-version="Microsoft Windows NT 5.1.2600 Service Pack 2" platform="Win32NT" cwd="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\bin\Debug" machine-name="PAVILION" user="Eric" user-domain="PAVILION" />
<culture-info current-culture="fr-BE" current-uiculture="fr-FR" />
<test-suite name="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\Navigio.nunit" success="True" time="0.250" asserts="0">
<results>
<test-suite name="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\bin\Debug\NavigioMap.Tests.dll" success="True" time="0.250" asserts="0">
<results>
<test-suite name="NavigioMap" success="True" time="0.250" asserts="0">
<results>
<test-suite name="Tests" success="True" time="0.234" asserts="0">
<results>
<test-suite name="TestBase" success="True" time="0.156" asserts="0">
<results>
<test-case name="NavigioMap.Tests.TestBase.test000" executed="True" success="True" time="0.016" asserts="0" />
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</test-results>
<!--This file represents the results of running a test suite-->
<test-results name="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\Navigio.nunit" total="1" failures="0" not-run="0" date="2012-01-16" time="09:25:59">
<environment nunit-version="2.4.3.0" clr-version="2.0.50727.3053" os-version="Microsoft Windows NT 5.1.2600 Service Pack 2" platform="Win32NT" cwd="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\bin\Debug" machine-name="PAVILION" user="Eric" user-domain="PAVILION" />
<culture-info current-culture="fr-BE" current-uiculture="fr-FR" />
<test-suite name="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\Navigio.nunit" success="True" time="0.250" asserts="0">
<results>
<test-suite name="C:\Eric\Biz\Navigio\NavigioMap\NavigioMap.Tests\bin\Debug\NavigioMap.Tests.dll" success="True" time="0.250" asserts="0">
<results>
<test-suite name="NavigioMap" success="True" time="0.250" asserts="0">
<results>
<test-suite name="Tests" success="True" time="0.234" asserts="0">
<results>
<test-suite name="TestBase" success="True" time="0.156" asserts="0">
<results>
<test-case name="NavigioMap.Tests.TestBase.test000" executed="True" success="True" time="0.016" asserts="0" />
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</test-results>
And finally, here is the TC log:
[09:30:35]: [DatabaseTests] ##teamcity[importData type='nunit' path='d:\temp\Nis\DatabaseTests\results.xml' verbose='true' parseOutOfDate='true']
[09:30:35]: Importing data from 'd:\temp\Nis\DatabaseTests\results.xml' with 'nunit' processor
[09:30:35]: NUnit report watcher
[09:30:35]: [NUnit report watcher] Watching paths:
[09:30:35]: [NUnit report watcher] d:\temp\Nis\DatabaseTests\results.xml
[09:30:35]: Process exited with code 0
[09:30:35]: NUnit report watcher
[09:30:35]: [NUnit report watcher] No reports found for paths:
[09:30:35]: [NUnit report watcher] d:\temp\Nis\DatabaseTests\results.xml
[09:30:35]: Waiting for 1 service processes to complete
[09:30:35]: Publishing internal artifacts (2s)
[09:30:38]: [Publishing internal artifacts] Sending build.finish.properties file
[09:30:38]: Build finished
Another weird point is that last week this same config/file/... worked :-{
Thank you for your help.
Eric
Please sign in to leave a comment.
Hello, Eric,
Did you make sure that the report is present at the specified path during the build?
Could you please enable debug logging on agent, rerun the build and attach the full build log and teamcity-agent.log.
By the way TeamCity provides bundled MSBuild runner that can normally automatically detect tests and eliminate the need for XML reports import.
Yes, and the file is removed upon the build runs.
The document does obsolutely not reflect the teamcity folder structure, but I finaly found the teamcity-agent.log file under D:\TeamCity\.BuildServer\system\caches\agentFiles\-686616066 (instead of <agent home>/logs as stated in the doc).
I don't find where to force the DEBUG level (as the <agent home>/conf/teamcity-agent-log4j.xml doesn't exist), but here's the teamcity-agent.log content:
We're working on another testing pattern : unit testing oracle stored procedure :-) and the result comes from a table. Therefore I generate a NUnit-like test result file in order to inform Teamcioty about the results.
Of course we already use intensively MSBuild runner for the .net projects :-)
Eric, sorry for ambiguity.
The asked teamcity-agent.log can be found on agent maschine in <agent home>/logs, as well as teamcity-agent-log4j.xml can be found on agent in <agent home>/conf where <agent home> is the place where build agent is installed.
.BuildServer\system\caches\ folder contains some internal files.
Shame on me!
Here i sthe MSBuild target I use:
<Target Name="DatabaseTests" DependsOnTargets="">
<Message Text="++++++++++++++++++++++++++++++++" Importance="high"/>
<Message Text="DatabaseTests Task" Importance="high"/>
<Message Text="++++++++++++++++++++++++++++++++" Importance="high"/>
<RemoveDir Directories="d:\temp\$(AppName)\DatabaseTests"/>
<MakeDir Directories="d:\temp\$(AppName)\DatabaseTests"/>
<CreateItem Include="$(MSBuildProjectDirectory)\..\Tests\DatabaseTests\bin\debug\BRail.Nis.DatabaseTests.dll"
AdditionalMetadata="TestContainerPrefix=/testcontainer:">
<Output TaskParameter="Include" ItemName="TestAssemblies" />
</CreateItem>
<!--The task above creates a TestAssemblies element, which contains a semicolon-delimited list of paths to every test assembly for the application.
Since the MSTest command line needs a space between each test assembly passed to it, the TestAssemblies element can’t be used as-is.
Each assembly also requires a “/testcontainer:” prefix. Both of these issues are addressed by the combined use of transforms, batching, and well-known metadata as shown below:-->
<!--<Exec Command="$(MSTestCommand) @(TestAssemblies->'%(TestContainerPrefix)%(FullPath)', ' ') /resultsfile:d:\temp\$(AppName)\DatabaseTests\results.xml /runconfig:$(MSBuildProjectDirectory)\..\LocalTestRun.testrunconfig"
IgnoreExitCode="true"
/>-->
<Message Text="##teamcity[importData type='nunit' path='d:\temp\$(AppName)\DatabaseTests\results.xml' verbose='true' parseOutOfDate='true']" Importance="high"/>
</Target>
While debugging I commented the process that generates the result.xml file (to be able to manually manage that file), but I forgot to comment the task that removes the test result directory (used to clean the build before job). Of course the result.xml that I manually copy to the folder is deleted during the build.
Great, the good news is that now it works fine ;-)