summaryrefslogtreecommitdiff
path: root/qa/qa/specs/runner.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-20 09:16:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-20 09:16:11 +0000
commitedaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch)
tree11f143effbfeba52329fb7afbd05e6e2a3790241 /qa/qa/specs/runner.rb
parentd8a5691316400a0f7ec4f83832698f1988eb27c1 (diff)
downloadgitlab-ce-14.7.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'qa/qa/specs/runner.rb')
-rw-r--r--qa/qa/specs/runner.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb
index d7d64834e7a..2c9e302fc56 100644
--- a/qa/qa/specs/runner.rb
+++ b/qa/qa/specs/runner.rb
@@ -9,6 +9,7 @@ module QA
attr_accessor :tty, :tags, :options
DEFAULT_TEST_PATH_ARGS = ['--', File.expand_path('./features', __dir__)].freeze
+ DEFAULT_STD_ARGS = [$stderr, $stdout].freeze
def initialize
@tty = false
@@ -19,13 +20,11 @@ module QA
def paths_from_knapsack
allocator = Knapsack::AllocatorBuilder.new(Knapsack::Adapters::RSpecAdapter).allocator
- QA::Runtime::Logger.info ''
+ QA::Runtime::Logger.info '==== Knapsack specs to execute ====='
QA::Runtime::Logger.info 'Report specs:'
QA::Runtime::Logger.info allocator.report_node_tests.join(', ')
- QA::Runtime::Logger.info ''
QA::Runtime::Logger.info 'Leftover specs:'
QA::Runtime::Logger.info allocator.leftover_node_tests.join(', ')
- QA::Runtime::Logger.info ''
['--', allocator.node_tests]
end
@@ -70,8 +69,15 @@ module QA
ParallelRunner.run(args.flatten)
elsif Runtime::Scenario.attributes[:loop]
LoopRunner.run(args.flatten)
+ elsif Runtime::Scenario.attributes[:count_examples_only]
+ args.unshift('--dry-run')
+ out = StringIO.new
+ RSpec::Core::Runner.run(args.flatten, $stderr, out).tap do |status|
+ abort if status.nonzero?
+ end
+ $stdout.puts out.string.match(/(\d+) examples,/)[1]
else
- RSpec::Core::Runner.run(args.flatten, $stderr, $stdout).tap do |status|
+ RSpec::Core::Runner.run(args.flatten, *DEFAULT_STD_ARGS).tap do |status|
abort if status.nonzero?
end
end