Parent `before(:context)` blocks are still executed if a nested `context` block is quarantined

When a context block is quarantined, if there's a before(:context) block it shouldn't be executed.

This works in the majority of cases where there's only one context block. But if context blocks are nested and one of the inner context blocks is quarantined, parent before(:context) blocks will be executed even if there is no unquarantined example to run.

That's what happened in qa/qa/specs/features/ee/browser_ui/1_manage/project/project_templates_spec.rb: !18978 (comment 236145886)

One option to avoid this is to not nest context blocks. But that's rather restrictive.

A proper fix would change the quarantine handling code to skip parent context blocks when they only include quarantined examples.

Edited Oct 27, 2019 by Mark Lapierre
Assignee Loading
Time tracking Loading