【问题标题】:Travis CI can't run the NUnit 3 Console RunnerTravis CI 无法运行 NUnit 3 Console Runner
【发布时间】:2016-03-31 17:24:41
【问题描述】:

我使用 Travis CI 设置了远程构建。这是我的配置文件:

language: csharp
solution: DungeonGen.sln
install:
  - nuget restore DungeonGen.sln
  - nuget install NUnit.Runners -OutputDirectory testrunner
script:
  - xbuild DungeonGen.sln /p:TargetFrameworkVersion="v4.5.1" /p:Configuration=Stress
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Generators/bin/Stress/DungeonGen.Tests.Unit.Generators.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Selectors/bin/Stress/DungeonGen.Tests.Unit.Selectors.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Mappers/bin/Stress/DungeonGen.Tests.Unit.Mappers.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Tables/bin/Stress/DungeonGen.Tests.Unit.Tables.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Integration/Bootstrap/bin/Stress/DungeonGen.Tests.Integration.Bootstrap.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Integration/Tables/bin/Stress/DungeonGen.Tests.Integration.Tables.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Integration/Stress/bin/Stress/DungeonGen.Tests.Integration.Stress.dll

但是,当它运行时,我得到以下异常:

$ mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll
Cannot open assembly './testrunner/NUnit.Console.*/tools/nunit3-console.exe': No such file or directory.
The command "mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll" exited with 2.

我尝试为测试加载的每个 DLL 都会重复此异常。根据the documentation for Travis CI,我应该能够在路径中使用通配符并且它工作正常。但是,要么是导致问题,要么是其他问题阻止 Travis 看到它刚刚安装的 exe。有谁知道解决这个问题?我真的不想硬编码 NUnit 的一个版本——我想尽可能使用最新的版本。

更新硬编码版本没有帮助 - 设置为 3.2.0,我仍然得到同样的错误:

install:
  - nuget restore DungeonGen.sln
  - nuget install NUnit.Runners -Version 3.2.0 -OutputDirectory testrunner

产生这个:

$ mono ./testrunner/NUnit.Console.3.2.0/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll
Cannot open assembly './testrunner/NUnit.Console.3.2.0/tools/nunit3-console.exe': No such file or directory.
The command "mono ./testrunner/NUnit.Console.3.2.0/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll" exited with 2.

【问题讨论】:

    标签: travis-ci nunit-console nunit-3.0


    【解决方案1】:

    原来包安装目录是错误的:应该是./testrunner/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe,而不是./testrunner/NUnit.Console.3.2.0/tools/nunit3-console.exe。不确定何时更改,但现在可以使用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多