NUnit / TeamCity进程已退出,代码为-4

时间:2019-09-16 09:15:09

标签: nunit teamcity

我有一个在本地运行的测试项目,没有问题,但是在我们的两个构建代理上它失败,并显示以下消息:

“进程退出,代码为-4(步骤:运行单元测试版本MeasurementProgram(NUnit))”

“代码-4”是什么意思?是TeamCity还是NUnit错误消息?我已经在Google上搜索了此特定错误消息,但一无所获。

构建步骤失败的构建日志如下:

[10:54:33][Step 8/10] Starting: C:\TeamCity\buildAgent\work\a6c5ca0ef741ad5d\MeasurementProgram\packages\NUnit.ConsoleRunner.3.9.0\tools\nunit3-console.exe C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit --result=C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit.xml --noheader --where (cat==LongRunning||cat==AlgorithmLongRunning||cat==PerformanceLongRunning||cat==RegressionTestLongRunning||cat==IntegrationTestLongRunning||cat==DoseRegressionLongRunning)&&cat!=AlgorithmInvestigation&&cat!=TestTools --framework=net-4.0 --inprocess
[10:54:33][Step 8/10] in directory: C:\TeamCity\buildAgent\work\a6c5ca0ef741ad5d\MeasurementProgram\DeviceCtrl.Test\bin\Release
[10:54:33][Step 8/10] Runtime Environment
[10:54:33][Step 8/10]    OS Version: Microsoft Windows NT 6.3.9600.0
[10:54:33][Step 8/10]   CLR Version: 4.0.30319.42000
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Test Files
[10:54:33][Step 8/10]     C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Test Filters
[10:54:33][Step 8/10]     Where: (cat==LongRunning||cat==AlgorithmLongRunning||cat==PerformanceLongRunning||cat==RegressionTestLongRunning||cat==IntegrationTestLongRunning||cat==DoseRegressionLongRunning)&&cat!=AlgorithmInvestigation&&cat!=TestTools
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Errors, Failures and Warnings
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] 1) Invalid : C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit
[10:54:33][Step 8/10] File type is not supported
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Test Run Summary
[10:54:33][Step 8/10]   Overall result: Failed
[10:54:33][Step 8/10]   Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
[10:54:33][Step 8/10]   Start time: 2019-09-16 08:54:33Z
[10:54:33][Step 8/10]     End time: 2019-09-16 08:54:33Z
[10:54:33][Step 8/10]     Duration: 0.026 seconds
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Results (nunit3) saved as C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit.xml
[10:54:34][Step 8/10] Process exited with code -4
[10:54:34][Step 8/10] NUnit process finished with negative exit code -4 (unexpected failure). Reporting step failure.
[10:54:34][Step 8/10] Publishing artifacts
[10:54:34][Publishing artifacts] Collecting files to publish: [C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity\bt42_RUNNER_76]
[10:54:34][Publishing artifacts] Publishing 1 file using [ArtifactsCachePublisher]: C:/TeamCity/buildAgent/temp/agentTmp/TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity/bt42_RUNNER_76
[10:54:34][Publishing artifacts] Publishing 1 file using [WebPublisher]: C:/TeamCity/buildAgent/temp/agentTmp/TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity/bt42_RUNNER_76
[10:54:34][Step 8/10] ##teamcity[publishArtifacts 'C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity\bt42_RUNNER_76']
[10:54:34][Step 8/10] Process exited with code -4 (Step: Run unit tests release MeasurementProgram (NUnit))
[10:54:34][Step 8/10] Step Run unit tests release MeasurementProgram (NUnit) failed```

2 个答案:

答案 0 :(得分:0)

似乎尚未安装TeamCity所需的某些扩展。

最简单的方法是使用Agent Tools在TeamCity代理上安装NUnit(它会自动安装所有必要的扩展)。

但是,如果要手动执行此操作,则需要为项目安装其他扩展。请在YouTrack中检查相关的documentation pagethis issue

答案 1 :(得分:0)

已通过将NUnit.ConsoleRunner更新到版本3.10.0解决了该问题。如此处的建议https://github.com/nunit/nunit/issues/1525