diff options
author | Walmyr Lima <walmyr@gitlab.com> | 2019-04-26 19:33:41 +0300 |
---|---|---|
committer | Walmyr Lima <walmyr@gitlab.com> | 2019-04-26 20:16:40 +0300 |
commit | eaba732e91e9b0d37d47e2cccacb1960daf95145 (patch) | |
tree | 3008b449de0cf7eff37d739b9eb9e8c6085ec1ff /qa | |
parent | bb6908cd5bcb14d70dfadbc2a16d7310bfa65445 (diff) |
Refactor quarantine helper
By moving methods closer to where they are called.
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/specs/helpers/quarantine.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/qa/qa/specs/helpers/quarantine.rb b/qa/qa/specs/helpers/quarantine.rb index 52cb05fcd13..ca0ce32e74f 100644 --- a/qa/qa/specs/helpers/quarantine.rb +++ b/qa/qa/specs/helpers/quarantine.rb @@ -20,6 +20,14 @@ module QA::Specs::Helpers 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. def skip_or_run_quarantined_tests_or_contexts(filters, example) if filters.key?(:quarantine) @@ -39,14 +47,6 @@ module QA::Specs::Helpers 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) filter.reject { |key, _| key == :quarantine } end |