373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
# File 'lib/rspec/queue.rb', line 373
def run_specs(example_groups)
examples = example_groups.flat_map(&:descendants).flat_map do |example_group|
example_group.filtered_examples.map do |example|
SingleExample.new(example_group, example)
end
end
queue = CI::Queue.from_uri(queue_url, RSpec::Queue.config)
if queue.retrying?
retry_queue = queue.retry_queue
if retry_queue.exhausted?
puts "Found 0 tests to retry, processing the main queue."
else
puts "Retrying #{retry_queue.size} failed tests."
queue = retry_queue
end
end
BuildStatusRecorder.build = queue.build
queue.populate(examples, random: ordering_seed, &:id)
examples_count = examples.size success = true
@configuration.reporter.report(examples_count) do |reporter|
@configuration.add_formatter(BuildStatusRecorder)
FileUtils.mkdir_p('log')
@configuration.add_formatter(OrderRecorder, open('log/test_order.log', 'w+'))
@configuration.with_suite_hooks do
break if @world.wants_to_quit
queue.poll do |example|
success &= example.run(QueueReporter.new(reporter, queue, example))
break if @world.wants_to_quit
end
end
end
return 0 if @world.non_example_failure
success ? 0 : @configuration.failure_exit_code
end
|