我有一些为 Xamarin 项目编写的小型 nunit 测试。它们在我的 Mac Mini 终端(Jenkins 构建平台)上运行得很好。但是,当我在 Jenkins 上运行相同的命令时,我收到一个无法解释的奇怪错误。即使我已尝试提供完整的文件路径并以 root 用户身份运行命令,我仍然遇到此错误。如果有人有相关经验,将不胜感激。
构建进程的命令:
错误、失败和警告 1)错误:ApplicationName='mono',CommandLine='--runtime=v4.0.30319"/Users/falconbot/Documents/NUnit/nunit-agent.exe" 8e81b5fe-8dba-4da0-8612-5c0cabe9d40f tcp://127.0.0.1:55001/TestAgency --pid=97532',CurrentDirectory='',Native error=找不到指定的文件 at System.Diagnostics.Process.StartWithCreateProcess(System.Diagnostics.ProcessStartInfo startInfo)[0x002dc] in <70507a44a84041d599bbfa8f3d0ea5b1>:0 at System.Diagnostics.Process.Start () [0x0003a] in <70507a44a84041d599bbfa8f3d0ea5b1>:0 at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start () at NUnit.Engine.Services.TestAgency.LaunchAgentProcess(NUnit.Engine.TestPackage package)[0x002f2] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at NUnit.Engine.Services.TestAgency.CreateRemoteAgent(NUnit.Engine.TestPackage package, System.Int32 waitTime) [0x00000] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package, System.Int32 waitTime) [0x00000] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at (wrapper remoting-invoke-with-check) NUnit.Engine.Services.TestAgency:GetAgent(NUnit.Engine.TestPackage,int) 在NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunner() [0x0003d]中<1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 在NUnit.Engine.Runners.ProcessRunner.RunTests(NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f]中<1e8ad6af4c6f4686ad7e5f9e67020b3b>:0
测试运行摘要 总体结果:失败 测试数:0,通过:0,失败:0,警告:0,不确定:0,跳过:0 开始时间:2017-09-28 18:18:49Z 结束时间:2017-09-28 18:18:49Z 持续时间:0.089秒
结果(nunit3)保存为TestResult.xml 建立步骤执行外壳部分将构建标记为失败
构建进程的命令:
nuget restore CoreTests.sln
msbuild CoreTests.sln /t:Build
mono nunit3-console.exe CoreTests.dll
错误输出:
NUnit控制台运行器3.7.0版 版权所有(c)2017 Charlie Poole,Rob Prouse 运行环境 OS 版本:MacOSX 16.6.0.0 CLR 版本:4.0.30319.42000 测试文件 CoreTests/CoreTests/bin/Debug/CoreTests.dll错误、失败和警告 1)错误:ApplicationName='mono',CommandLine='--runtime=v4.0.30319"/Users/falconbot/Documents/NUnit/nunit-agent.exe" 8e81b5fe-8dba-4da0-8612-5c0cabe9d40f tcp://127.0.0.1:55001/TestAgency --pid=97532',CurrentDirectory='',Native error=找不到指定的文件 at System.Diagnostics.Process.StartWithCreateProcess(System.Diagnostics.ProcessStartInfo startInfo)[0x002dc] in <70507a44a84041d599bbfa8f3d0ea5b1>:0 at System.Diagnostics.Process.Start () [0x0003a] in <70507a44a84041d599bbfa8f3d0ea5b1>:0 at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start () at NUnit.Engine.Services.TestAgency.LaunchAgentProcess(NUnit.Engine.TestPackage package)[0x002f2] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at NUnit.Engine.Services.TestAgency.CreateRemoteAgent(NUnit.Engine.TestPackage package, System.Int32 waitTime) [0x00000] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package, System.Int32 waitTime) [0x00000] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at (wrapper remoting-invoke-with-check) NUnit.Engine.Services.TestAgency:GetAgent(NUnit.Engine.TestPackage,int) 在NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunner() [0x0003d]中<1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 在NUnit.Engine.Runners.ProcessRunner.RunTests(NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f]中<1e8ad6af4c6f4686ad7e5f9e67020b3b>:0
测试运行摘要 总体结果:失败 测试数:0,通过:0,失败:0,警告:0,不确定:0,跳过:0 开始时间:2017-09-28 18:18:49Z 结束时间:2017-09-28 18:18:49Z 持续时间:0.089秒
结果(nunit3)保存为TestResult.xml 建立步骤执行外壳部分将构建标记为失败