Sha256: be379acc6a9f9485bcf25eb53bc26128ae3645f4814799b89a0a92ca4d11dfcb

Contents?: true

Size: 818 Bytes

Versions: 49

Compression:

Stored size: 818 Bytes

Contents

module Knapsack
  module Distributors
    class LeftoverDistributor < BaseDistributor
      def report_tests
        @report_tests ||= report.keys
      end

      def leftover_tests
        @leftover_tests ||= all_tests - report_tests
      end

      private

      def post_assign_test_files_to_node
        node_index = 0
        leftover_tests.each do |test_file|
          node_tests[node_index] << test_file
          node_index += 1
          node_index %= ci_node_total
        end
      end

      def post_tests_for_node(node_index)
        test_files = node_tests[node_index]
        return unless test_files
        test_files
      end

      def default_node_tests
        @node_tests = []
        ci_node_total.times do |index|
          @node_tests[index] = []
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
knapsack-4.0.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-3.1.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-3.0.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-2.0.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.22.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.21.1 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.21.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.20.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.19.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.18.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.17.2 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.17.1 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.17.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.16.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.15.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.14.1 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.14.0 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.13.3 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.13.2 lib/knapsack/distributors/leftover_distributor.rb
knapsack-1.13.1 lib/knapsack/distributors/leftover_distributor.rb