summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-08-03 13:25:14 +0200
committerRémy Coutable <remy@rymai.me>2018-08-26 19:20:16 +0200
commite6cc0eea8c30bbdafd98c4169736f1f8d2f6c346 (patch)
treee9e857a52b295524cae075947827ce5353ec113b
parent68b84d8154a92876fb2c308b2ca16eb78f2b3933 (diff)
downloadgitlab-ce-e6cc0eea8c30bbdafd98c4169736f1f8d2f6c346.tar.gz
Allow to pass --tag to bin/qa run
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--qa/qa/scenario/template.rb8
-rw-r--r--qa/qa/scenario/test/instance.rb7
-rw-r--r--qa/spec/runtime/env_spec.rb4
-rw-r--r--qa/spec/scenario/test/instance/all_spec.rb8
-rw-r--r--qa/spec/scenario/test/instance/smoke_spec.rb2
5 files changed, 24 insertions, 5 deletions
diff --git a/qa/qa/scenario/template.rb b/qa/qa/scenario/template.rb
index 66eb86f25c8..a87d925ce32 100644
--- a/qa/qa/scenario/template.rb
+++ b/qa/qa/scenario/template.rb
@@ -21,14 +21,18 @@ module QA
def perform(address, *rspec_options)
Runtime::Scenario.define(:gitlab_address, address)
+ ##
+ # Perform before hooks, which are different for CE and EE
+ #
+ Runtime::Release.perform_before_hooks
+
Specs::Runner.perform do |specs|
specs.tty = true
- specs.tags = self.class.focus
specs.options =
if rspec_options.any?
rspec_options
else
- ::File.expand_path('../specs/features', __dir__)
+ ['--tag', self.class.focus.join(','), '--', ::File.expand_path('../specs/features', __dir__)]
end
end
end
diff --git a/qa/qa/scenario/test/instance.rb b/qa/qa/scenario/test/instance.rb
index b9a73d3ffb8..e41c742376a 100644
--- a/qa/qa/scenario/test/instance.rb
+++ b/qa/qa/scenario/test/instance.rb
@@ -20,13 +20,18 @@ module QA
def self.do_perform(address, *rspec_options)
Runtime::Scenario.define(:gitlab_address, address)
+ ##
+ # Perform before hooks, which are different for CE and EE
+ #
+ Runtime::Release.perform_before_hooks
+
Specs::Runner.perform do |specs|
specs.tty = true
specs.options =
if rspec_options.any?
rspec_options
else
- ::File.expand_path('../specs/features', __dir__)
+ ['--tag', self.class.focus.join(','), '--', ::File.expand_path('../../specs/features', __dir__)]
end
end
end
diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb
index ccc0b906845..5493a33cd2a 100644
--- a/qa/spec/runtime/env_spec.rb
+++ b/qa/spec/runtime/env_spec.rb
@@ -104,6 +104,8 @@ describe QA::Runtime::Env do
describe '.github_access_token' do
it 'returns "" if GITHUB_ACCESS_TOKEN is not defined' do
+ stub_env('GITHUB_ACCESS_TOKEN', nil)
+
expect(described_class.github_access_token).to eq('')
end
@@ -115,6 +117,8 @@ describe QA::Runtime::Env do
describe '.require_github_access_token!' do
it 'raises ArgumentError if GITHUB_ACCESS_TOKEN is not defined' do
+ stub_env('GITHUB_ACCESS_TOKEN', nil)
+
expect { described_class.require_github_access_token! }.to raise_error(ArgumentError)
end
diff --git a/qa/spec/scenario/test/instance/all_spec.rb b/qa/spec/scenario/test/instance/all_spec.rb
index 423527e938e..1d96352550b 100644
--- a/qa/spec/scenario/test/instance/all_spec.rb
+++ b/qa/spec/scenario/test/instance/all_spec.rb
@@ -1,4 +1,10 @@
describe QA::Scenario::Test::Instance::All do
+ subject do
+ Class.new(described_class) do
+ tags :rspec, :foo
+ end
+ end
+
context '#perform' do
let(:arguments) { spy('Runtime::Scenario') }
let(:release) { spy('Runtime::Release') }
@@ -24,7 +30,7 @@ describe QA::Scenario::Test::Instance::All do
subject.perform("test")
expect(runner).to have_received(:options=)
- .with(::File.expand_path('../../../../qa/specs/features', __dir__))
+ .with(['--tag', 'rspec,foo', '--', ::File.expand_path('../../../../qa/specs/features', __dir__)])
end
end
diff --git a/qa/spec/scenario/test/instance/smoke_spec.rb b/qa/spec/scenario/test/instance/smoke_spec.rb
index e79d19e8212..386eefae930 100644
--- a/qa/spec/scenario/test/instance/smoke_spec.rb
+++ b/qa/spec/scenario/test/instance/smoke_spec.rb
@@ -30,7 +30,7 @@ describe QA::Scenario::Test::Instance::Smoke do
subject.perform("test")
expect(runner).to have_received(:options=)
- .with(::File.expand_path('../../../../qa/specs/features', __dir__))
+ .with(['--tag', 'smoke', '--', ::File.expand_path('../../../../qa/specs/features', __dir__)])
end
end