1

Albacore 发行说明说xunit 任务支持一个skip_test_fail参数

“防止 rake 在 xunit 测试失败时中止构建。这在持续集成场景中很有用,例如与 TeamCity 一起运行。”

没有显示示例,我尝试使用它(如下)没有成功。它应该如何工作?

desc "XUnit Test Runner Example"
xunit :xunit do |xunit|
  xunit.command = "../xunit-1.8/xunit.console.clr4.exe"
  xunit.assembly = "Islambox.Web.Test/bin/Debug/Islambox.Web.Test.dll"
  xunit.skip_test_fail
end
4

1 回答 1

0

我查看了 xunit 任务,发现该参数确实存在。这是一个可以设置为某个值的常规“属性”。

attr_accessor :html_output, :skip_test_fail

它用于后缀if条件,如果属性的值为falseor ,则返回 false nil。任何其他值都将返回true

if !result && (!@skip_test_fail || $?.exitstatus > 1)

因此,只需将其设置为任何值!我建议true这样可以更清楚地了解发生了什么。我已经用这些信息更新了 wiki 。

xunit.skip_test_fail = true
于 2012-09-27T20:42:13.767 回答