summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2018-03-26 13:29:45 +0200
committerBrett Walker <bwalker@gitlab.com>2018-03-26 13:29:45 +0200
commit2df7d86462a1b32ac123163da12b1860584463c0 (patch)
tree93bbe2ca6c8a2e930ec409df73bfcf03d4a348d8
parent545d52ce6ca1b296230b20cd2b219919ae38007b (diff)
downloadgitlab-ce-bw-qa-rspec-options.tar.gz
allow rspec files/options to be passed down in all casesbw-qa-rspec-options
-rw-r--r--qa/qa/scenario/bootable.rb2
-rw-r--r--qa/qa/scenario/test/instance.rb8
-rw-r--r--qa/qa/scenario/test/integration/mattermost.rb4
-rw-r--r--qa/qa/specs/runner.rb6
-rw-r--r--qa/spec/scenario/test/instance_spec.rb4
5 files changed, 12 insertions, 12 deletions
diff --git a/qa/qa/scenario/bootable.rb b/qa/qa/scenario/bootable.rb
index d6de4d404c8..dd12ea6d492 100644
--- a/qa/qa/scenario/bootable.rb
+++ b/qa/qa/scenario/bootable.rb
@@ -23,7 +23,7 @@ module QA
arguments.parse!(argv)
- self.perform(**Runtime::Scenario.attributes)
+ self.perform(Runtime::Scenario.attributes, *arguments.default_argv)
end
private
diff --git a/qa/qa/scenario/test/instance.rb b/qa/qa/scenario/test/instance.rb
index 0af9afd1ea4..567e5fd6cca 100644
--- a/qa/qa/scenario/test/instance.rb
+++ b/qa/qa/scenario/test/instance.rb
@@ -11,7 +11,7 @@ module QA
tags :core
- def perform(address, *files)
+ def perform(address, *rspec_options)
Runtime::Scenario.define(:gitlab_address, address)
##
@@ -22,9 +22,9 @@ module QA
Specs::Runner.perform do |specs|
specs.tty = true
specs.tags = self.class.focus
- specs.files =
- if files.any?
- files
+ specs.options =
+ if rspec_options.any?
+ rspec_options
else
File.expand_path('../../specs/features', __dir__)
end
diff --git a/qa/qa/scenario/test/integration/mattermost.rb b/qa/qa/scenario/test/integration/mattermost.rb
index d939f52ab16..13bfad28b0b 100644
--- a/qa/qa/scenario/test/integration/mattermost.rb
+++ b/qa/qa/scenario/test/integration/mattermost.rb
@@ -9,10 +9,10 @@ module QA
class Mattermost < Test::Instance
tags :core, :mattermost
- def perform(address, mattermost, *files)
+ def perform(address, mattermost, *rspec_options)
Runtime::Scenario.define(:mattermost_address, mattermost)
- super(address, *files)
+ super(address, *rspec_options)
end
end
end
diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb
index 752e3e60b8c..f8f6fe65599 100644
--- a/qa/qa/specs/runner.rb
+++ b/qa/qa/specs/runner.rb
@@ -3,19 +3,19 @@ require 'rspec/core'
module QA
module Specs
class Runner < Scenario::Template
- attr_accessor :tty, :tags, :files
+ attr_accessor :tty, :tags, :options
def initialize
@tty = false
@tags = []
- @files = [File.expand_path('./features', __dir__)]
+ @options = [File.expand_path('./features', __dir__)]
end
def perform
args = []
args.push('--tty') if tty
tags.to_a.each { |tag| args.push(['-t', tag.to_s]) }
- args.push(files)
+ args.push(options)
Runtime::Browser.configure!
diff --git a/qa/spec/scenario/test/instance_spec.rb b/qa/spec/scenario/test/instance_spec.rb
index bd09c28e924..a74a9538be8 100644
--- a/qa/spec/scenario/test/instance_spec.rb
+++ b/qa/spec/scenario/test/instance_spec.rb
@@ -29,7 +29,7 @@ describe QA::Scenario::Test::Instance do
it 'should call runner with default arguments' do
subject.perform("test")
- expect(runner).to have_received(:files=)
+ expect(runner).to have_received(:options=)
.with(File.expand_path('../../../qa/specs/features', __dir__))
end
end
@@ -38,7 +38,7 @@ describe QA::Scenario::Test::Instance do
it 'should call runner with paths' do
subject.perform('test', 'path1', 'path2')
- expect(runner).to have_received(:files=).with(%w[path1 path2])
+ expect(runner).to have_received(:options=).with(%w[path1 path2])
end
end
end