Commit 673275f4 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'acunskis-dont-skip-quarantine-local' into 'master'

E2E: Allow to disable quarantine functionality for e2e specs

See merge request gitlab-org/gitlab!79056
parents dbece389 9dbce56e
...@@ -120,3 +120,5 @@ Similarly to specifying that a test should only run against a specific environme ...@@ -120,3 +120,5 @@ Similarly to specifying that a test should only run against a specific environme
test only when it runs against a specific environment. The syntax is exactly the same, except that the `only: { ... }` test only when it runs against a specific environment. The syntax is exactly the same, except that the `only: { ... }`
hash is nested in the [`quarantine: { ... }`](https://about.gitlab.com/handbook/engineering/quality/guidelines/debugging-qa-test-failures/#quarantining-tests) hash. hash is nested in the [`quarantine: { ... }`](https://about.gitlab.com/handbook/engineering/quality/guidelines/debugging-qa-test-failures/#quarantining-tests) hash.
For example, `quarantine: { only: { subdomain: :staging } }` only quarantines the test when run against `staging`. For example, `quarantine: { only: { subdomain: :staging } }` only quarantines the test when run against `staging`.
The quarantine feature can be explicitly disabled with the `DISABLE_QUARANTINE` environment variable. This can be useful when running tests locally.
...@@ -438,6 +438,10 @@ module QA ...@@ -438,6 +438,10 @@ module QA
ENV['QA_EE_ACTIVATION_CODE'] ENV['QA_EE_ACTIVATION_CODE']
end end
def quarantine_disabled?
enabled?(ENV['DISABLE_QUARANTINE'], default: false)
end
private private
def remote_grid_credentials def remote_grid_credentials
......
...@@ -10,8 +10,10 @@ module QA ...@@ -10,8 +10,10 @@ module QA
extend self extend self
# Skip tests in quarantine unless we explicitly focus on them. # Skip tests in quarantine unless we explicitly focus on them or quarantine disabled
def skip_or_run_quarantined_tests_or_contexts(example) def skip_or_run_quarantined_tests_or_contexts(example)
return if Runtime::Env.quarantine_disabled?
if filters.key?(:quarantine) if filters.key?(:quarantine)
included_filters = filters_other_than_quarantine included_filters = filters_other_than_quarantine
......
...@@ -104,6 +104,20 @@ RSpec.describe QA::Specs::Helpers::Quarantine do ...@@ -104,6 +104,20 @@ RSpec.describe QA::Specs::Helpers::Quarantine do
end end
describe '.skip_or_run_quarantined_tests_or_contexts' do describe '.skip_or_run_quarantined_tests_or_contexts' do
context 'with explicitly disabled quarantine' do
before do
stub_env('DISABLE_QUARANTINE', 'true')
end
it 'runs quarantined test' do
group = describe_successfully do
it('is pending', :quarantine) {}
end
expect(group.examples.first.execution_result.status).to eq(:passed)
end
end
context 'with no tag focused' do context 'with no tag focused' do
it 'skips quarantined tests' do it 'skips quarantined tests' do
group = describe_successfully do group = describe_successfully do
......
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