Sha256: 393e98f6c6be503698969b2723be2acbe965351c6a0fe41f37936942914e2f09

Contents?: true

Size: 1.07 KB

Versions: 103

Compression:

Stored size: 1.07 KB

Contents

module KnapsackPro
  module Runners
    class BaseRunner
      def self.run(args)
        raise NotImplementedError
      end

      def initialize(adapter_class)
        @allocator_builder = KnapsackPro::AllocatorBuilder.new(adapter_class)
        @allocator = allocator_builder.allocator
      end

      def test_file_paths
        @test_file_paths ||= allocator.test_file_paths
      end

      def stringify_test_file_paths
        KnapsackPro::TestFilePresenter.stringify_paths(test_file_paths)
      end

      def test_dir
        allocator_builder.test_dir
      end

      def test_files_to_execute_exist?
        if test_file_paths.empty?
          KnapsackPro.logger.info("Knapsack Pro API returned no test files to execute for the node this time. The reason might be that you changed recently a number of total nodes or you removed some test files. Please create a new commit to get a better test suite split next time.")
          false
        else
          true
        end
      end

      private

      attr_reader :allocator_builder,
        :allocator
    end
  end
end

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
knapsack_pro-0.55.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.54.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.53.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.52.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.51.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.50.1 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.50.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.49.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.48.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.47.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.46.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.45.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.44.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.43.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.42.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.41.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.40.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.39.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.38.0 lib/knapsack_pro/runners/base_runner.rb
knapsack_pro-0.37.0 lib/knapsack_pro/runners/base_runner.rb