From a3672898522d46a23d06b05d0360d2149cb49520 Mon Sep 17 00:00:00 2001 From: Gabriel Arjones Date: Fri, 23 Jun 2023 20:48:23 -0300 Subject: [PATCH] fix: Remove logs during cache cleanup --- lib/autoproj/cli/ci.rb | 1 + test/autoproj/cli/ci_test.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/autoproj/cli/ci.rb b/lib/autoproj/cli/ci.rb index 5f91b4f..33826f9 100644 --- a/lib/autoproj/cli/ci.rb +++ b/lib/autoproj/cli/ci.rb @@ -337,6 +337,7 @@ def cleanup_build_cache(dir, size_limit) FileUtils.rm_f path FileUtils.rm_f "#{path}.json" + FileUtils.rm_f "#{path}.logs" total_size -= stat.size end diff --git a/test/autoproj/cli/ci_test.rb b/test/autoproj/cli/ci_test.rb index bf4d70f..ff206fc 100644 --- a/test/autoproj/cli/ci_test.rb +++ b/test/autoproj/cli/ci_test.rb @@ -665,6 +665,7 @@ def self.consolidated_report_single_behavior( # rubocop:disable Metrics/AbcSize @paths.each do |p| assert File.exist?(p) assert File.exist?("#{p}.json") + assert File.exist?("#{p}.logs") end assert_equal 4096, result end @@ -677,10 +678,12 @@ def self.consolidated_report_single_behavior( # rubocop:disable Metrics/AbcSize [@paths[1], @paths[3]].each do |p| assert File.exist?(p) assert File.exist?("#{p}.json") + assert File.exist?("#{p}.logs") end [@paths[0], @paths[2]].each do |p| refute File.exist?(p) refute File.exist?("#{p}.json") + refute File.exist?("#{p}.logs") end assert_equal 2048, result end @@ -691,6 +694,7 @@ def create_file(path, size) io.write " " * size end FileUtils.touch "#{path}.json" + FileUtils.touch "#{path}.logs" path end end