2020-06-02 05:08:01 -04:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-08-25 11:10:17 -04:00
|
|
|
require 'test_file_finder'
|
2020-06-02 05:08:01 -04:00
|
|
|
|
2021-09-08 05:09:10 -04:00
|
|
|
changes = ARGV.shift
|
2020-06-02 05:08:01 -04:00
|
|
|
output_file = ARGV.shift
|
|
|
|
|
2021-09-08 05:09:10 -04:00
|
|
|
changed_files = File.read(changes).split(' ')
|
2020-06-02 05:08:01 -04:00
|
|
|
|
2020-12-09 10:10:12 -05:00
|
|
|
tff = TestFileFinder::FileFinder.new(paths: changed_files).tap do |file_finder|
|
|
|
|
file_finder.use TestFileFinder::MappingStrategies::PatternMatching.load('tests.yml')
|
2021-09-07 05:11:43 -04:00
|
|
|
|
|
|
|
if ENV['RSPEC_TESTS_MAPPING_ENABLED']
|
|
|
|
file_finder.use TestFileFinder::MappingStrategies::DirectMatching.load_json(ENV['RSPEC_TESTS_MAPPING_PATH'])
|
|
|
|
end
|
2020-12-09 10:10:12 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
File.write(output_file, tff.test_files.uniq.join(' '))
|