gpt4 book ai didi

travis-ci - Travis CI 无法运行 NUnit 3 Console Runner

转载 作者:行者123 更新时间:2023-12-01 11:27:17 25 4
gpt4 key购买 nike

我使用 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.

最佳答案

原来是包安装目录错了:而不是./testrunner/NUnit.Console.3.2.0/tools/nunit3-console.exe ,应该是./testrunner/NUnit.ConsoleRunner.3.2.0/tools/nunit3-console.exe .不知道这什么时候改变,但它现在有效。

关于travis-ci - Travis CI 无法运行 NUnit 3 Console Runner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36339850/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com