2

我正在尝试配置 TeamCity 来运行我们拥有的测试。

我创建了一个 NUnit 构建步骤,并选择了以下参数:

运行器类型:NUnit 步骤名称:测试 执行步骤:仅当所有先前的步骤都成功时 NUnit 运行器:NUnit 2.6.1 .NET 运行时:x64,v4.0 从以下位置运行测试:'Tests**\bin\Debug\Tests.* .dll'

其余为空白。

这是构建日志中的输出

[14:03:31]Step 2/2: Tests (NUnit) (14s)
[14:03:31][Step 2/2] Starting: C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[14:03:31][Step 2/2] in directory: C:\BuildAgent\work\743f6358429d804a
[14:03:39][Step 2/2] Start TeamCity NUnit Test Runner
[14:03:39][Step 2/2] Running NUnit-2.6.1 tests under .NET Framework v4.0 x64
[14:03:40][Step 2/2] Tests.Application.XmlImport.dll
[14:03:44][Step 2/2] Start TeamCity NUnit Test Runner
[14:03:44][Step 2/2] Running NUnit-2.6.1 tests under .NET Framework v4.0 x64
[14:03:45][Step 2/2] Tests.Infrastructure.Framework.dll
[14:03:45][Step 2/2] Process exited with code 0

为了确保测试没有运行,每个程序集都有一个 Assert.Fail() 测试。

仅供参考:该项目使用 .NET 4.5,NUnit 程序集为 2.6.2

谢谢。

4

1 回答 1

1

最后,我发现 TeamCity 没有重新构建测试并且程序集仍在使用 MSTest 属性,因此 NUnit 找不到它们。

于 2012-10-27T11:29:17.800 回答