Commit eaba732e authored by Walmyr Lima's avatar Walmyr Lima

Refactor quarantine helper

By moving methods closer to where they are called.
parent bb6908cd
...@@ -20,6 +20,14 @@ module QA::Specs::Helpers ...@@ -20,6 +20,14 @@ module QA::Specs::Helpers
end end
end end
# Skip the entire context if a context is quarantined. This avoids running
# before blocks unnecessarily.
def skip_or_run_quarantined_contexts(filters, example)
return unless example.metadata.key?(:quarantine)
skip_or_run_quarantined_tests_or_contexts(filters, example)
end
# Skip tests in quarantine unless we explicitly focus on them. # Skip tests in quarantine unless we explicitly focus on them.
def skip_or_run_quarantined_tests_or_contexts(filters, example) def skip_or_run_quarantined_tests_or_contexts(filters, example)
if filters.key?(:quarantine) if filters.key?(:quarantine)
...@@ -39,14 +47,6 @@ module QA::Specs::Helpers ...@@ -39,14 +47,6 @@ module QA::Specs::Helpers
end end
end end
# Skip the entire context if a context is quarantined. This avoids running
# before blocks unnecessarily.
def skip_or_run_quarantined_contexts(filters, example)
return unless example.metadata.key?(:quarantine)
skip_or_run_quarantined_tests_or_contexts(filters, example)
end
def filters_other_than_quarantine(filter) def filters_other_than_quarantine(filter)
filter.reject { |key, _| key == :quarantine } filter.reject { |key, _| key == :quarantine }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment