Commit 520fcaab authored by Rémy Coutable's avatar Rémy Coutable

Allow to pass --tag to bin/qa run

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 02e9a8f9
......@@ -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
......
......@@ -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
......
......@@ -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
......
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
......
......@@ -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
......
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