Welcome to mirror list, hosted at ThFree Co, Russian Federation.

knapsack_runner.rb « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4908553e43dbb68d2f9e8c09d6c0e59e4ed15d89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module QA
  module Specs
    class KnapsackRunner
      def self.run(args)
        allocator = Knapsack::AllocatorBuilder.new(Knapsack::Adapters::RSpecAdapter).allocator

        Knapsack.logger.info '==== Knapsack specs to execute ====='
        Knapsack.logger.info 'Report specs:'
        Knapsack.logger.info allocator.report_node_tests
        Knapsack.logger.info 'Leftover specs:'
        Knapsack.logger.info allocator.leftover_node_tests

        status = RSpec::Core::Runner.run([*args, '--', *allocator.node_tests])
        yield status if block_given?
        status
      end
    end
  end
end