开发者

How to set up autotest to rerun only failing rspec examples

开发者 https://www.devze.com 2023-04-13 08:55 出处:网络
My impression of how autotest is intended to work (based on the cucumber github wiki, and other stuff online) is that it should rerun red examples until they pass. My problem is that it reruns all exa

My impression of how autotest is intended to work (based on the cucumber github wiki, and other stuff online) is that it should rerun red examples until they pass. My problem is that it reruns all examples in the spec file where a failing example is found, including passing ones. I'd rather not waste time 开发者_如何学运维rerunning passing examples while fixing a failing one. Can autotest be configured so only the failing examples are run?


You need the rspec-retry gem. Here are some examples from the docs on how to implement it:

Apply it in a configure block covering your entire test-suite...

RSpec.configure do |config|
    config.verbose_retry = true # show retry status in spec process
    config.default_retry_count = 3
end

Or apply it unit-by-unit...

it 'should randomly succeed', :retry => 3 do
    expect(rand(2)).to eq(1)
end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号