我在jenkins作业中尝试使用nunit时遇到了一些问题。尽管nunit-2.6 1的文档指出,您可以指定用于测试的构建配置,但这似乎不起作用。我尝试使用"Release“配置运行测试,但nunit尝试加载Debug程序集并失败:(我使用以下调用启动nunit:
nunit-console-x86.exe ambiHomeWPFTest\Tests\Tests.csproj /config:Release有谁知道这是怎么回事吗?我是一个来自java背景的.NET新手,所以我可能会怀念一些简单的东西。
1
[test_ambiHomeWPFTest_master] $ cmd /c call C:\Windows\TEMP\hudson8704126216198591607.bat
c:\jenkins\workspace\test_ambiHomeWPFTest_master>nunit-console-x86.exe ambiHomeWPFTest\Tests\Tests.csproj /config:Release
NUnit-Console version 2.6.0.12051
Copyright (C) 2002-20011 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 2.0.50727.5456 ( Net 3.5 )
ProcessModel: Default DomainUsage: Default
Execution Runtime: net-3.5
Unhandled Exception:
System.IO.DirectoryNotFoundException: Ein Teil des Pfades "c:\jenkins\workspace\test_ambiHomeWPFTest_master\ambiHomeWPFTest\Tests\bin\Debug\Tests.dll " konnte nicht gefunden werden.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
bei NUnit.Core.AssemblyReader.CalcHeaderOffsets()
bei NUnit.Core.AssemblyReader..ctor(String assemblyPath)
bei NUnit.Util.RuntimeFrameworkSelector.SelectRuntimeFramework(TestPackage package)
bei NUnit.Util.DefaultTestRunnerFactory.GetTargetProcessModel(TestPackage package)
bei NUnit.Util.DefaultTestRunnerFactory.MakeTestRunner(TestPackage package)
bei NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
bei NUnit.ConsoleRunner.Runner.Main(String[] args)
c:\jenkins\workspace\test_ambiHomeWPFTest_master>exit -100
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE发布于 2012-06-19 16:23:06
如果在例如nunit-console-x86命令中引用DLL时遇到/config:开关的问题,我建议您显式引用感兴趣的.csproj。
在上面的场景中,调用应该是:
nunit-console-x86 ambiHomeWPFTest\Tests\bin\Release\Tests.dllhttps://stackoverflow.com/questions/11086158
复制相似问题