Menu

#49 nunitreport uses wrong base dir when nunit2 fails

open
nobody
None
5
2004-11-07
2004-11-07
No

Versions:

NAnt 0.85 (Build 0.85.1771.0; nightly; 11/6/2004)
NAnt-contrib-0.85 nightly build of 11/3/2004.

Extract from build script:

<nunit2 failonerror="false">
<formatter type="Xml" usefile="true"
outputdir="${nunit.home}"
extension=".xml"/>
<test>
<assemblies refid="fileset2test"/>
</test>
</nunit2>
<!-- nunitreport seems to be stuck with the wrong base dir
when a test fails with an exception in nunit2 -->
<nunitreport out="${nunit.home}/report.html">
<fileset>
<include name="${nunit.home}/*.xml"/>
</fileset>
</nunitreport>

Extract from nant output with "nunit.home" set to "nunit":

test:

[nunit2]
c:\work\Replicon\Replicon\StarTeam\Replicon\QuickBooks
Integration\Mainstream\QBIntegration.build(35,3):
[nunit2] Tests Failed.:
[nunit2] NAnt.Core.BuildException:
c:\work\Replicon\Replicon\StarTeam\Replicon\QuickBooks
Integration\Mainstream\QBIntegration.build(35,3):
[nunit2] Tests Failed.
[nunit2] at
NAnt.NUnit2.Tasks.NUnit2Task.ExecuteTask() in
d:\Source\nant-20041106T220136Z\src\ NAnt.NUnit\NUnit2\NUnit2Task.cs:line 231
[nunit2] at NAnt.Core.Task.Execute() in
d:\Source\nant-20041106T220136Z\src\NAnt.Core\Task.cs:
line 169

BUILD FAILED - 2 non-fatal error(s), 0 warning(s)

INTERNAL ERROR

System.IO.DirectoryNotFoundException: Could not find a
part of the path
"c:\work\Replicon\Replicon\StarTeam\Replicon\QuickBooks
Integration\Mainstream\Production\WTStoQBIntegrator\bin\debug\nunit\repo
rt.html".
at System.IO.__Error.WinIOError(Int32 errorCode,
String str)
at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access, FileShare share, Int
32 bufferSize, Boolean useAsync, String msgPath,
Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access, FileShare share)
at System.Xml.XmlTextWriter..ctor(String filename,
Encoding encoding)
at NAnt.Contrib.Tasks.NUnitReportTask.ExecuteTask()
in d:\Source\nantcontrib-20041103T210313Z\src
\Tasks\NUnitReportTask.cs:line 135
at NAnt.Core.Task.Execute() in
d:\Source\nant-20041106T220136Z\src\NAnt.Core\Task.cs:line
177
at NAnt.Core.Target.Execute() in
d:\Source\nant-20041106T220136Z\src\NAnt.Core\Target.cs:line
249

at NAnt.Core.Project.Execute(String targetName,
Boolean forceDependencies) in d:\Source\nant-2004
1106T220136Z\src\NAnt.Core\Project.cs:line 876
at NAnt.Core.Project.Execute() in
d:\Source\nant-20041106T220136Z\src\NAnt.Core\Project.cs:line
8
33
at NAnt.Core.Project.Run() in
d:\Source\nant-20041106T220136Z\src\NAnt.Core\Project.cs:line
902

NOTES:

Notice that nunitreport is computing the path to the
out file relative to where nunit2 was probably stuck
when an exception happened rather than using the
directory from which nant was launched as the base dir.

Discussion


Log in to post a comment.