Commit 3dd81214 authored by Anastasia McDonald's avatar Anastasia McDonald

Merge branch 'qe-staging-ref-context-selector' into 'master'

Account for Staging Ref in E2E context selector

See merge request gitlab-org/gitlab!74231
parents 80f681f7 5dce3398
......@@ -45,11 +45,11 @@ module QA
opts[:subdomain] = case option[:subdomain]
when Array
"(#{option[:subdomain].join("|")})."
"(#{option[:subdomain].join("|")})\\."
when Regexp
option[:subdomain]
else
"(#{option[:subdomain]})."
"(#{option[:subdomain]})\\."
end
end
end
......
......@@ -186,6 +186,24 @@ RSpec.describe QA::Specs::Helpers::ContextSelector do
end
end
context 'staging-ref' do
before do
QA::Runtime::Scenario.define(:gitlab_address, 'https://staging-ref.gitlab.com/')
end
it 'runs on staging-ref' do
group = describe_successfully do
it('does not run in staging', only: { subdomain: :staging }) {}
it('runs in staging-ref', only: { subdomain: /^staging-ref./ }) {}
end
aggregate_failures do
expect(group.examples[0].execution_result.status).to eq(:pending)
expect(group.examples[1].execution_result.status).to eq(:passed)
end
end
end
context 'production' do
before do
QA::Runtime::Scenario.define(:gitlab_address, 'https://gitlab.com/')
......
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