debian-mirror-gitlab/tooling/bin/find_tests

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
560 B
Text
Raw Normal View History

2020-06-23 00:09:42 +05:30
#!/usr/bin/env ruby
# frozen_string_literal: true
2020-11-24 15:15:51 +05:30
require 'test_file_finder'
2020-06-23 00:09:42 +05:30
2021-11-11 11:23:49 +05:30
changes = ARGV.shift
2020-06-23 00:09:42 +05:30
output_file = ARGV.shift
2021-11-11 11:23:49 +05:30
changed_files = File.read(changes).split(' ')
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
tff = TestFileFinder::FileFinder.new(paths: changed_files).tap do |file_finder|
file_finder.use TestFileFinder::MappingStrategies::PatternMatching.load('tests.yml')
2020-06-23 00:09:42 +05:30
2021-02-22 17:27:13 +05:30
if ENV['RSPEC_TESTS_MAPPING_ENABLED']
file_finder.use TestFileFinder::MappingStrategies::DirectMatching.load_json(ENV['RSPEC_TESTS_MAPPING_PATH'])
end
end
File.write(output_file, tff.test_files.uniq.join(' '))