我对于CI(来自全新的设置点至少)颇为陌生。我在Rider中创建了一个项目,使用默认版本的NUnit,如果您选择“创建新的NUnit项目”,我会尝试使用Travis-CI为其设置自动构建版本。.NET项目Nunit测试在单声道编译期间失败
我的项目和测试项目的目标.NET框架版本(在Rider项目属性中确认)是4.5。
我使用的Nunit版本是随Rider 3.5提供的默认版本。
这里是我的.travis.yml构建文件:
language: csharp
solution: .sln
install:
- nuget restore FindWordsWithConcatenations.sln
- nuget install NUnit.Runners -Version 3.5.0 -OutputDirectory testrunner
script:
- xbuild /p:Configuration=Debug ./FindWordsWithConcatenations.sln
- mono ./testrunner/NUnit.ConsoleRunner.3.5.0/tools/nunit-agent.exe ./TestFindWordsWithConcatenations/bin/Debug/TestFindWordsWithConcatenations.dll
我通过运行的NuGet命令测试运行路径应该是正确的,当我运行NUnit的代理(通过我自己的机器上证实代理,代理的x86,或代理控制台)我得到以下错误(在当地,并在服务器上):
Unhandled Exception: System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid..ctor(String g)
at NUnit.Agent.NUnitTestAgent.Main(String[] args)
我也试图与指定配置模式下运行,并与调试的配置模式和发布指定。
不幸的是,谷歌搜索/堆栈溢出的正常策略并没有帮助,我在几个问题中看到了这个错误,但是这个原因似乎与我所经历的无关。
The last build of the pipeline is available to view here,到目前为止所有的构建都失败了,以前的构建可以看到here。
在此先感谢,如果有人对此问题的原因有任何了解,或者我可以如何以不同方式处理测试,我将不胜感激。