xamarin - 在 Jenkins 上运行 NUnit 测试的问题

标签 xamarin jenkins mono nunit nunit-console

我为 Xamarin 项目编写了一些小的 nunit 测试。它们在我的 Mac Mini(jenkins 构建平台)的终端上运行良好。当我在 jenkins 上运行相同的命令时,我收到一个我无法解释的奇怪错误。我试过提供完整的文件路径并以 root 身份运行命令,但仍然抛出此错误。如果有人对此有任何经验,将不胜感激。

构建过程命令:

nuget restore CoreTests.sln
msbuild CoreTests.sln /t:Build
mono nunit3-console.exe CoreTests.dll

错误输出:

NUnit Console Runner 3.7.0 Copyright (c) 2017 Charlie Poole, Rob Prouse

Runtime Environment OS Version: MacOSX 16.6.0.0 CLR Version: 4.0.30319.42000

Test Files CoreTests/CoreTests/bin/Debug/CoreTests.dll

Errors, Failures and Warnings

1) Error : 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= Cannot find the specified file 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) at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunner () [0x0003d] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0 at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f] in <1e8ad6af4c6f4686ad7e5f9e67020b3b>:0

Test Run Summary Overall result: Failed Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0 Start time: 2017-09-28 18:18:49Z End time: 2017-09-28 18:18:49Z Duration: 0.089 seconds

Results (nunit3) saved as TestResult.xml Build step 'Execute shell' marked build as failure

最佳答案

如果您没有错误地进入第三行,我建议它应该是:

nunit3-console.exe <workspace_relative_path_to_project_containing_tests>.dll

免责声明:我是 NUnit 项目的贡献者和 Saucery3 的作者nuget 包。但我不是单声道专家。

关于xamarin - 在 Jenkins 上运行 NUnit 测试的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46346587/

相关文章:

android - Xamarin 强制我下载 Android SDK 和 NDK

ios - 为什么我的 UIViewController 顶部有 20px 的间隙?

git - Jenkins Git 插件包含的区域不起作用

linux - 如何在 Jenkins 中设置管道构建的字符串名称

Java 'Email Sending Code' > 已知异常(索引 : 14, 大小 : 14)?

.net - Mono 是 .NET 的子集吗?

Mono 的 .Net 组件

c# - Xamarin Forms MasterDetailPage 主页隐藏菜单按钮

c# - 如何将 Image.Source 获取为字符串

c# - P/调用 C# 到 C++