NoRedInk / rspec-retry

retry randomly failing rspec example
MIT License
585 stars 96 forks source link

Retry skips include_context calls #70

Open ghost opened 7 years ago

ghost commented 7 years ago

I have an include_context call before my it statement that I want to retry, this include_context contains a before_all. When the test fails, the it-statement is reran, but the before_all inside the include_context is not. Also if there is a failure in the include_context, then the test is not reran at all. Here is an example

describe "Cool Operation", :retry => 10, :verbose_retry => true,  do

  include_context('cool setup - before all')

  it 'does cool stuff' do
    expect(@var_setup_in_before_all).to eq(CoolObject)
  end
end

I have tried setting the :retry option on the 'it' statement and the 'describe' statement, but neither will retry the include_context. Does this gem support this feature?

michaelglass commented 7 years ago

I think: rspec_retry reruns the test as part of the suite so doesn't rerun before(:all) (it should rerun before(:each)) The logic to retry a whole context or describe block is something I haven't touched.