Commit 8b5072e6 authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-shl-introduce-skip-live-env-meta' into 'master'

Introduce `skip_live_env` RSpec meta and add it to tests

Closes gitlab-org/quality/team-tasks#493

See merge request gitlab-org/gitlab!30661
parents 2b3ba352 01e40ca7
......@@ -14,3 +14,4 @@ This is a partial list of the [RSpec metadata](https://relishapp.com/rspec/rspec
| `:reliable` | The test has been [promoted to a reliable test](https://about.gitlab.com/handbook/engineering/quality/guidelines/reliable-tests/#promoting-an-existing-test-to-reliable) meaning it passes consistently in all pipelines, including merge requests. |
| `:requires_admin` | The test requires an admin account. Tests with the tag are excluded when run against Canary and Production environments. |
| `:runner` | The test depends on and will set up a GitLab Runner instance, typically to run a pipeline. |
| `:skip_live_env` | The test will be excluded when run against live deployed environments such as Staging, Canary, and Production. |
......@@ -3,8 +3,7 @@ require 'securerandom'
module QA
context 'Manage' do
# TODO: Remove the :orchestrated meta after https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/493 is complete
describe 'Group access', :requires_admin, :orchestrated do
describe 'Group access', :requires_admin, :skip_live_env do
include Runtime::IPAddress
before(:all) do
......
......@@ -2,8 +2,7 @@
require 'securerandom'
module QA
# TODO: Remove the :orchestrated meta after https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/493 is complete
context 'Create', :docker, :orchestrated, :requires_admin do
context 'Create', :docker, :requires_admin, :skip_live_env do
describe 'Jenkins integration' do
let(:project_name) { "project_with_jenkins_#{SecureRandom.hex(4)}" }
......
......@@ -42,6 +42,8 @@ module QA
tags_for_rspec.push(%w[--tag ~skip_signup_disabled]) if QA::Runtime::Env.signup_disabled?
tags_for_rspec.push(%w[--tag ~skip_live_env]) if QA::Runtime::Env.dot_com?
QA::Runtime::Env.supported_features.each_key do |key|
tags_for_rspec.push(%W[--tag ~requires_#{key}]) unless QA::Runtime::Env.can_test? key
end
......
......@@ -14,6 +14,8 @@ describe QA::Specs::Runner do
describe '#perform' do
before do
allow(QA::Runtime::Browser).to receive(:configure!)
QA::Runtime::Scenario.define(:gitlab_address, "http://gitlab.test")
end
it_behaves_like 'excludes orchestrated'
......@@ -80,6 +82,18 @@ describe QA::Specs::Runner do
end
end
context 'when running against live environment' do
before do
QA::Runtime::Scenario.define(:gitlab_address, "https://staging.gitlab.com")
end
it 'includes default args and excludes the skip_live_env tag' do
expect_rspec_runner_arguments(['--tag', '~orchestrated', '--tag', '~skip_live_env', *described_class::DEFAULT_TEST_PATH_ARGS])
subject.perform
end
end
context 'testable features' do
shared_examples 'one supported feature' do |feature|
before 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