Skip to content

Commit

Permalink
Merge pull request #23 from rock-core/remove_logs_during_cache_cleanup
Browse files Browse the repository at this point in the history
fix: Remove logs during cache cleanup
  • Loading branch information
g-arjones authored Jun 27, 2023
2 parents 3ca2344 + a367289 commit 735d7dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/autoproj/cli/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions test/autoproj/cli/ci_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -691,6 +694,7 @@ def create_file(path, size)
io.write " " * size
end
FileUtils.touch "#{path}.json"
FileUtils.touch "#{path}.logs"
path
end
end
Expand Down

0 comments on commit 735d7dd

Please sign in to comment.