diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /qa/spec | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/scenario/template_spec.rb | 25 | ||||
-rw-r--r-- | qa/spec/spec_helper.rb | 1 | ||||
-rw-r--r-- | qa/spec/specs/runner_spec.rb | 2 | ||||
-rw-r--r-- | qa/spec/support/shared_examples/scenario_shared_examples.rb | 1 |
4 files changed, 21 insertions, 8 deletions
diff --git a/qa/spec/scenario/template_spec.rb b/qa/spec/scenario/template_spec.rb index f07d817ea16..9800f92b306 100644 --- a/qa/spec/scenario/template_spec.rb +++ b/qa/spec/scenario/template_spec.rb @@ -3,6 +3,7 @@ RSpec.describe QA::Scenario::Template do let(:feature) { spy('Runtime::Feature') } let(:release) { spy('Runtime::Release') } + let(:gitlab_address) { 'https://gitlab.com/' } before do stub_const('QA::Runtime::Release', release) @@ -12,7 +13,7 @@ RSpec.describe QA::Scenario::Template do end it 'allows a feature to be enabled' do - subject.perform({ enable_feature: 'a-feature' }) + subject.perform({ gitlab_address: gitlab_address, enable_feature: 'a-feature' }) expect(feature).to have_received(:enable).with('a-feature') end @@ -21,7 +22,7 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(true) - subject.perform({ disable_feature: 'another-feature' }) + subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) expect(feature).to have_received(:disable).with('another-feature') end @@ -30,7 +31,7 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(false) - subject.perform({ disable_feature: 'another-feature' }) + subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) expect(feature).not_to have_received(:disable).with('another-feature') end @@ -38,7 +39,7 @@ RSpec.describe QA::Scenario::Template do it 'ensures an enabled feature is disabled afterwards' do allow(QA::Specs::Runner).to receive(:perform).and_raise('failed test') - expect { subject.perform({ enable_feature: 'a-feature' }) }.to raise_error('failed test') + expect { subject.perform({ gitlab_address: gitlab_address, enable_feature: 'a-feature' }) }.to raise_error('failed test') expect(feature).to have_received(:enable).with('a-feature') expect(feature).to have_received(:disable).with('a-feature') @@ -50,7 +51,7 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(true) - expect { subject.perform({ disable_feature: 'another-feature' }) }.to raise_error('failed test') + expect { subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) }.to raise_error('failed test') expect(feature).to have_received(:disable).with('another-feature') expect(feature).to have_received(:enable).with('another-feature') @@ -62,9 +63,21 @@ RSpec.describe QA::Scenario::Template do allow(QA::Runtime::Feature).to receive(:enabled?) .with('another-feature').and_return(false) - expect { subject.perform({ disable_feature: 'another-feature' }) }.to raise_error('failed test') + expect { subject.perform({ gitlab_address: gitlab_address, disable_feature: 'another-feature' }) }.to raise_error('failed test') expect(feature).not_to have_received(:disable).with('another-feature') expect(feature).not_to have_received(:enable).with('another-feature') end + + it 'defines an about address by default' do + subject.perform( { gitlab_address: gitlab_address }) + + expect(QA::Runtime::Scenario.gitlab_address).to eq(gitlab_address) + expect(QA::Runtime::Scenario.about_address).to eq('https://about.gitlab.com/') + + subject.perform({ gitlab_address: 'http://gitlab-abc.test/' }) + + expect(QA::Runtime::Scenario.gitlab_address).to eq('http://gitlab-abc.test/') + expect(QA::Runtime::Scenario.about_address).to eq('http://about.gitlab-abc.test/') + end end diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb index 631ebf65893..0c9643c830b 100644 --- a/qa/spec/spec_helper.rb +++ b/qa/spec/spec_helper.rb @@ -3,6 +3,7 @@ require_relative '../qa' require 'rspec/retry' require 'rspec-parameterized' +require 'active_support/core_ext/hash' if ENV['CI'] && QA::Runtime::Env.knapsack? && !ENV['NO_KNAPSACK'] require 'knapsack' diff --git a/qa/spec/specs/runner_spec.rb b/qa/spec/specs/runner_spec.rb index 642d9e0745b..021ce9091e0 100644 --- a/qa/spec/specs/runner_spec.rb +++ b/qa/spec/specs/runner_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'active_support/core_ext/hash' - RSpec.describe QA::Specs::Runner do shared_examples 'excludes orchestrated, transient, and geo' do it 'excludes the orchestrated, transient, and geo tags, and includes default args' do diff --git a/qa/spec/support/shared_examples/scenario_shared_examples.rb b/qa/spec/support/shared_examples/scenario_shared_examples.rb index 637cfb9a05d..5e448349cf9 100644 --- a/qa/spec/support/shared_examples/scenario_shared_examples.rb +++ b/qa/spec/support/shared_examples/scenario_shared_examples.rb @@ -18,6 +18,7 @@ module QA stub_const('QA::Runtime::Scenario', attributes) stub_const('QA::Runtime::Feature', feature) + allow(attributes).to receive(:gitlab_address).and_return(args[:gitlab_address]) allow(runner).to receive(:perform).and_yield(runner) allow(QA::Runtime::Address).to receive(:valid?).and_return(true) end |