NCover 3.0 Integration in MsBuild Gives "Undefined parameters" Error

Hi All,

We failed to create a coverage report using NCover 3.0, NUnit, MsBuilld build runner and TeamCity 5.0.1.

Our build configuration (with ".NET Coverage tool" set to NCover 3.0) calls the following MsBuild target
  <Target Name="UnitTests">
        <Exec Command="$(TCNunitLauncher) ANY x64 NUnit-2.4.8 /category-include:$(TestCategory) $(NUnitAssemblies)" />
  </Target>  


Where two of the three variables are passed into the script through the "Command Line Parameters":
/p:TestCategory=smoke /p:TCNunitLauncher=%system.teamcity.dotnet.nunitlauncher%

The build configuration executes successfully but does neither execute any test nor creates a coverage report. The full build log shows the following problem


C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe ANY x64 NUnit-2.4.8 /category-include:smoke bin\Release\A1.NUnit.dll bin\Release\A2.NUnit.dll
2009-12-28 16:24:32,810 [4424] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Undefined parameters x64 ANY
System.Exception: Undefined parameters x64 ANY
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Executable(PlatformType req, PlatformVersion env) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 224
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.CreateArguments(String executable, PlatformVersion env, PlatformType platform, String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 69
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Run(String executable, PlatformVersion env, PlatformType platform, String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 37
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, String assembly, String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 30
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.RunWithCommandLine(PlatformVersion env, PlatformType platform, Assembly assembly, String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 24
at JetBrains.TeamCity.Utils.Runtime.RunInRuntime.DoRunInRuntime(PlatformVersion version, PlatformType type, Assembly assembly, String[] args, Int32& exitCode) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\RunInRuntime.cs:line 33
at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run2(String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 73
at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run(String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 45
D:\TeamCity\BuildAgent\work\41e6765d75ca944d\F.msbuild(87, 3): error MSB3073: The command "C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe ANY x64 NUnit-2.4.8 /category-include:smoke bin\Release\A1.NUnit.dll bin\Release\A2.NUnit.dll" exited with code -1.



Replacing x64 with MSIL in the MsBuild file fixes the problem with tests not being executed but still fails to create the coverage report

C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe ANY MSIL NUnit-2.4.8 /category-include:smoke bin\Release\A1.NUnit.dll bin\Release\A2.NUnit.dll
2009-12-28 16:28:07,018 [3092] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to apply ITestRunnerExtension of JetBrains.TeamCity.CoverageSupport.CoverageRunner Undefined parameters MSIL ANY
System.Exception: Undefined parameters MSIL ANY
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.Executable(PlatformType req, PlatformVersion env) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 224
at JetBrains.TeamCity.Utils.Runtime.ProcessRun.CreateArguments(String executable, PlatformVersion env, PlatformType platform, String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\Utils\src\Runtime\ProcessRun.cs:line 69
at JetBrains.TeamCity.NUnitCommon.AsProcess..ctor(ITestRunArguments args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\NUnitCommon\src\AsProcess.cs:line 22
at JetBrains.TeamCity.CoverageSupport.CoverageRunner.Extend(ITestRunner runner) in c:\BuildAgent\work\3f3d88bdf17c1223\src\CoverageSupport\src\CoverageRunner.cs:line 48
at JetBrains.BuildServer.NAntLoggers.NUnitLauncher2.Run2(String[] args) in c:\BuildAgent\work\3f3d88bdf17c1223\src\NUnitBootstrap\src\NUnitLauncher2.cs:line 120


System information: Windows 2003 64-bit, build runner settings "Run platform" and "Run NCover under" are set to x64

Any ideas what goes wrong here?

Thanks
Marcel

2 comments
Comment actions Permalink

Thank you for feedback and sorry for delay in answering.

This is an issue of TeamCity NUnit runner. It is impossible to start the build with ANY x64 configuration. You should specift v2.0 instead of ANY. (note, .NET 1.1 does not support x64 execution).

I'll improve the logging of that in TeamCity 5.1.

Please check if it work:
<Target Name="UnitTests">
        <Exec Command="$(TCNunitLauncher) v2.0 x64 NUnit-2.4.8 /category-include:$(TestCategory) $(NUnitAssemblies)" />
  </Target>

Thanks!

0
Comment actions Permalink

Hello Eugene

Thanks for your answer. In the meantime we switched using the MsBuild Community Task "NUnit" and got it up and running (with the exception of NUnit addins not working, but this is another discussion).

Marcel

0

Please sign in to leave a comment.