Commit 9abc0b341ef113f9ca1b6a44c9bc64a74134ad68
1 parent
51b16d00
Exists in
master
and in
29 other branches
ci: avoid running test over files that were deleted
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
lib/tasks/ci.rake
... | ... | @@ -6,7 +6,9 @@ namespace :ci do |
6 | 6 | current_branch = `git rev-parse --abbrev-ref HEAD`.strip |
7 | 7 | from = ENV['PREV_HEAD'] || "origin/#{current_branch}" |
8 | 8 | to = ENV['HEAD'] || current_branch |
9 | - changed_files = `git diff --name-only #{from}..#{to}`.split | |
9 | + changed_files = `git diff --name-only #{from}..#{to}`.split.select do |f| | |
10 | + File.exist?(f) | |
11 | + end | |
10 | 12 | |
11 | 13 | # explicitly changed tests |
12 | 14 | tests = changed_files.select { |f| f =~ /test\/.*_test\.rb$/ } | ... | ... |