summaryrefslogtreecommitdiff
path: root/qa/spec/specs
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-09-03 12:08:49 +0200
committerRémy Coutable <remy@rymai.me>2018-09-04 19:34:12 +0200
commit144b017d77c341849d37927b765c75888569d530 (patch)
tree358d02e9b748f683ca7fd4c3e0aed37ea19dd6a3 /qa/spec/specs
parent3e1466d99d7ef34c0b42a07e6db3329896374b41 (diff)
downloadgitlab-ce-144b017d77c341849d37927b765c75888569d530.tar.gz
[QA] Fix Specs::Runner that would always excluding the orchectsrated tag
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa/spec/specs')
-rw-r--r--qa/spec/specs/runner_spec.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/qa/spec/specs/runner_spec.rb b/qa/spec/specs/runner_spec.rb
new file mode 100644
index 00000000000..b237b954889
--- /dev/null
+++ b/qa/spec/specs/runner_spec.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+describe QA::Specs::Runner do
+ context '#perform' do
+ before do
+ allow(QA::Runtime::Browser).to receive(:configure!)
+ end
+
+ it 'excludes the orchestrated tag by default' do
+ expect(RSpec::Core::Runner).to receive(:run)
+ .with(['--tag', '~orchestrated', File.expand_path('../../qa/specs/features', __dir__)], $stderr, $stdout)
+ .and_return(0)
+
+ subject.perform
+ end
+
+ context 'when tty is set' do
+ subject do
+ described_class.new.tap do |runner|
+ runner.tty = true
+ end
+ end
+
+ it 'sets the `--tty` flag' do
+ expect(RSpec::Core::Runner).to receive(:run)
+ .with(['--tty', '--tag', '~orchestrated', File.expand_path('../../qa/specs/features', __dir__)], $stderr, $stdout)
+ .and_return(0)
+
+ subject.perform
+ end
+ end
+
+ context 'when tags are set' do
+ subject do
+ described_class.new.tap do |runner|
+ runner.tags = %i[orchestrated github]
+ end
+ end
+
+ it 'focuses on the given tags' do
+ expect(RSpec::Core::Runner).to receive(:run)
+ .with(['--tag', 'orchestrated', '--tag', 'github', File.expand_path('../../qa/specs/features', __dir__)], $stderr, $stdout)
+ .and_return(0)
+
+ subject.perform
+ end
+ end
+ end
+end