8

我在使用 Nunit build runner 从 teamcity 运行 Nunit 测试时遇到问题。

到目前为止,这些测试都是从托管 Teamcity 和构建代理的机器上运行的。测试在这台机器上按预期运行。但是我们正在将测试从这台机器移到另一台机器上,当我尝试从这台机器上运行测试时,我收到以下错误

[10:57:25]: 2012-08-01 10:57:25,688 [9052] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Compatible parser was not found
[10:57:25]: JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[10:57:25]: Arguments will be recieved implicitly
[10:57:25]: JetBrains.BuildServer.NUnitLauncher.exe @@ <xml-arguments-file>
[10:57:25]: JetBrains.BuildServer.NUnitLauncher.exe {v1.1|v2.0|mono-1.0|mono-2.0|ANY} {MSIL|x86|x64} Plugin{|Plugin...}
[10:57:25]: Plugin PartCover:
[10:57:25]: /partcover:<path to PartCover.exe> [/partcover-arg:<arg>]* [/partcover-arguments:<arguments line>] [/partcover-platform:<MSIL|x86|x64|NATIVE>@<v1.1|v2.0|ANY|NATIVE>] [/partcover-reg:true]
[10:57:25]: Where:
[10:57:25]: /partcover-arg: argument should be repeated for every argument of PartCover
[10:57:25]: /partcover-arguments: argument should be excaped to be passed to the program as one argument
[10:57:25]: Plugin mstest:
[10:57:25]: /mstestlocation:[ directory name ] /testcontainer:[ file name ] [/isolated] /runconfig:[ file name ]
[10:57:25]: Plugin dotCover:
[10:57:25]: /dotcover:<path to dotCover.exe> [/dotcover-platform:<MSIL|x86|x64|NATIVE>@<v1.1|v2.0|ANY|NATIVE>] [/dotcover-logs:<logs_folder>]
[10:57:25]: Plugin NCover:
[10:57:25]: /ncover:<path to NCover.Console.exe> [/ncover-arg:<arg>]* [/ncover-arguments:<arguments line>] [/ncover-platform:<MSIL|x86|x64|NATIVE>@<v1.1|v2.0|ANY|NATIVE>]
[10:57:25]: Where:
[10:57:25]: /ncover-arg: argument should be repeated for every argument of NCover
[10:57:25]: /ncover-arguments: argument should be excaped to be passed to the program as one argument
[10:57:25]: Plugin NUnit-*:
[10:57:25]: No assemblies were found.
[10:57:25]: No assemblies were found.
[10:57:25]: [/category-include:categories] [/category-exclude:categories] [/addin:addins] [/runAssemblies:processPerAssembly] <assembly>[(;| )<assembly>[...]]
[10:57:25]: Supported plugin names:
[10:57:25]: NUnit-2.2.10
[10:57:25]: NUnit-2.2.9-VSTS
[10:57:25]: NUnit-2.2.9-VSTS-9.0
[10:57:25]: NUnit-2.4.1
[10:57:25]: NUnit-2.4.6
[10:57:25]: NUnit-2.4.7
[10:57:25]: NUnit-2.4.8
[10:57:25]: NUnit-2.4.8-resharper
[10:57:25]: NUnit-2.5.0
[10:57:25]: NUnit-2.5.10
[10:57:25]: NUnit-2.5.2
[10:57:25]: NUnit-2.5.3
[10:57:25]: NUnit-2.5.4
[10:57:25]: NUnit-2.5.5
[10:57:25]: NUnit-2.5.6
[10:57:25]: NUnit-2.5.7
[10:57:25]: NUnit-2.5.7-resharper
[10:57:25]: NUnit-2.5.8
[10:57:25]: NUnit-2.5.9
[10:57:25]: 2012-08-01 10:57:25,712 [9052] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to parse arguments
[10:57:25]: Process exited with code -1

运行这些测试的构建代理在一台机器上(比如 Machine-a),而测试在另一台机器(Machine-b)上。所以我在 Machine-a 上使用构建代理在 Machine-b 上运行测试并抛出上述错误。我不确定这是否有效,因为构建代理在另一台机器上。

我还在 Machine-c 上安装了另一个构建代理。所以我尝试使用同一台机器的(Machine-c)构建代理运行 Machine-c 上的 nunits 测试,并得到以下错误。

[14:33:02]: 2012-08-01 14:33:02,755 [3116] ERROR JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to parse arguments
[14:33:02]: No assemblies were found.
[14:33:02]: Process exited with code -1

所以我很困惑我是否在 Machine-b、Machine-c 上丢失了一些 nunit 程序集(可以很容易地从另一台机器上复制)或者还有其他问题。

我还想知道 Teamcity、构建代理和 nunit 测试是否应该在同一台机器上成功运行测试(就像我们现在一样)。

有人可以帮我解决这个问题。

谢谢。

4

1 回答 1

4

实际上,我无法运行测试的原因是,我试图使用网络共享名称来访问测试程序集。但是 Teamcity 的 NUnit 构建运行器需要一个相对于它的 checkout/build 目录或绝对路径的路径,但不是具有网络共享名称的路径。

于 2012-08-02T13:33:56.577 回答