在Linux操作系统上,能否使用Jenkins运行用C#编写并使用NUnit测试的代码?我可以找到很多关于使用Jenkins运行NUnit测试的信息,但找不到关于我的情况的任何解释。更新:看起来是可能的。我需要在Linux上使用主Jenkins来运行Windows中的从Jenkins。这在文章中有描述。
这在Linux上使用mono相对容易。1)安装NUnit Console。sudo apt-get install monodevelop-nunit2)在Jenkins项目的“生成”中,在MSBuild步骤之后,“添加生成步骤”,选择“执行Shell”。cd "$WORKSPACE" # so nunit does not fail on file operations export MONO_IOMAP=all nunit-console ./UnitTests/UnitTests.csproj 我遇到的唯一问题是由于Nancy试图访问项目的bin/Debug目录而导致的失败测试。(在相同环境设置下,该项目在mono下正常运行) 后来我们放弃了Nancy,这个问题也就不再存在了。