From 9abc0b341ef113f9ca1b6a44c9bc64a74134ad68 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 31 Oct 2014 11:08:03 -0200 Subject: [PATCH] ci: avoid running test over files that were deleted --- lib/tasks/ci.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 072a1a7..90f119e 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -6,7 +6,9 @@ namespace :ci do current_branch = `git rev-parse --abbrev-ref HEAD`.strip from = ENV['PREV_HEAD'] || "origin/#{current_branch}" to = ENV['HEAD'] || current_branch - changed_files = `git diff --name-only #{from}..#{to}`.split + changed_files = `git diff --name-only #{from}..#{to}`.split.select do |f| + File.exist?(f) + end # explicitly changed tests tests = changed_files.select { |f| f =~ /test\/.*_test\.rb$/ } -- libgit2 0.21.2