如何解决Nunit.Console runner 在 System.ComponentModel.Win32Exception 上失败
我正在尝试将项目从 nunit-console 3.11.1
更新为 3.12.0
。我正在使用 nuget 版本将它包含在我的项目中。测试在我的本地系统和构建节点(连接到 Jenkins)上运行。所有测试项目都使用 Nunit 包版本 3.13.2
在本地运行测试时,它们成功完成,但在构建节点上运行(自动或手动)时,它们在 System.ComponentModel.Win32Exception
上失败。完整的输出:
d:\workspace\NugetUpdatesed0cf38d>"packages\nunit.consolerunner\3.12.0\tools\nunit3-console.exe" --result="smoke.xml" --where "cat == SmokeTest" --labels=Before --trace=debug "DnaSmokeTests\bin\Debug\net472\DnaSmokeTests.dll"
NUnit Console Runner 3.12.0 (.NET 2.0)
copyright (c) 2021 Charlie Poole,Rob Prouse
donderdag 29 juli 2021 10:49:07
Runtime Environment
OS Version: Microsoft Windows NT 6.2.9200.0
Runtime: .NET Framework CLR v4.0.30319.42000
Test Files
DnaSmokeTests\bin\Debug\net472\DnaSmokeTests.dll
Test Filters
Where: cat == SmokeTest
Errors,Failures and Warnings
1) Error :
System.ComponentModel.Win32Exception : The system cannot find the file specified
--Win32Exception
The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(processstartinfo startInfo)
at NUnit.Engine.Services.TestAgency.CreateRemoteAgent(TestPackage package,Int32 waitTime)
at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunner()
at NUnit.Engine.Runners.ProcessRunner.RunTests(ITestEventListener listener,TestFilter filter)
Test Run Summary
Overall result: Failed
Test Count: 0,Passed: 0,Failed: 0,Warnings: 0,Inconclusive: 0,Skipped: 0
Start time: 2021-07-29 08:49:07Z
End time: 2021-07-29 08:49:07Z
Duration: 0.047 seconds
Results (nunit3) saved as smoke.xml
在我的工作站上本地运行相同的提交时,测试成功。
C:\Users\n.otten\.nuget\packages\nunit.consolerunner\3.12.0\tools> .\nunit3-console.exe --result="smoke.xml" --where "cat == SmokeTest" --labels=Before "c:\git\projectname\DnaSmokeTests\bin\Debug\net472\DnaSmokeTests.dll"
NUnit Console Runner 3.12.0 (.NET 2.0)
copyright (c) 2021 Charlie Poole,Rob Prouse
donderdag 29 juli 2021 09:17:35
Runtime Environment
OS Version: Microsoft Windows NT 6.2.9200.0
Runtime: .NET Framework CLR v4.0.30319.42000
Test Files
c:\git\projectname\DnaSmokeTests\bin\Debug\net472\DnaSmokeTests.dll
Test Filters
Where: cat == SmokeTest
[skipping test output]
Run Settings
disposeRunners: True
workdirectory: C:\Users\n.otten\.nuget\packages\nunit.consolerunner\3.12.0\tools
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
TargetRuntimeFramework: net-4.0
NumberOfTestWorkers: 8
Test Run Summary
Overall result: Passed
Test Count: 48,Passed: 48,Skipped: 0
Start time: 2021-07-29 07:17:36Z
End time: 2021-07-29 08:03:10Z
Duration: 2734.462 seconds
Results (nunit3) saved as smoke.xml
此外,该解决方案还有其他测试项目。这些在不同的构建节点上执行并在那里成功。但是,当被迫在故障节点上运行时,它们将沿着与上述崩溃相同的路线运行。
可能是我在 3.12 中添加的受影响构建节点上缺少某种先决条件,如果是这样,那可能是什么?我一直认为软件包的 nuget 版本是自包含的。 Ea:添加包,调用 exe,如果您的测试 dll 正确编译,它应该可以工作。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。