Sha256: 4225176abfce27ebe644694183aaf97d0d64e3b6a569227a815f2aa7f29ed060

Contents?: true

Size: 1.32 KB

Versions: 21

Compression:

Stored size: 1.32 KB

Contents

module KnapsackPro
  class SlowTestFileFinder
    # Get recorded test files from API.
    # Find slow tests among them that are still present on the disk.
    # Save slow test files in json file on the disk.
    # Returns slow test files.
    def self.call(adapter_class)
      if KnapsackPro::Config::Env.test_files_encrypted?
        raise "Split by test cases is not possible when you have enabled test file names encryption ( #{KnapsackPro::Urls::ENCRYPTION} ). You need to disable encryption with KNAPSACK_PRO_TEST_FILES_ENCRYPTED=false in order to use split by test cases #{KnapsackPro::Urls::SPLIT_BY_TEST_EXAMPLES}"
      end

      # get list of recorded test files for last CI Build
      build_distribution_entity = KnapsackPro::BuildDistributionFetcher.call
      test_files_from_api = build_distribution_entity.test_files

      merged_test_files_from_api = KnapsackPro::TestCaseMergers::BaseMerger.call(adapter_class, test_files_from_api)

      test_files_existing_on_disk = KnapsackPro::TestFileFinder.select_test_files_that_can_be_run(adapter_class, merged_test_files_from_api)

      slow_test_files = KnapsackPro::SlowTestFileDeterminer.call(test_files_existing_on_disk, build_distribution_entity.time_execution)

      KnapsackPro::SlowTestFileDeterminer.save_to_json_report(slow_test_files)

      slow_test_files
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
knapsack_pro-5.5.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.4.1 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.4.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.3.5 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.3.4 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.3.3 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.3.2 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.3.1 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.3.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.2.1 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.2.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.1.2 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.1.1 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.1.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-5.0.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-4.1.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-4.0.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-3.11.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-3.10.0 lib/knapsack_pro/slow_test_file_finder.rb
knapsack_pro-3.9.0 lib/knapsack_pro/slow_test_file_finder.rb