Method: AppMap::Depends::TestFileInspector::TestReport#clean_appmaps

Defined in:
lib/appmap/depends/test_file_inspector.rb

#clean_appmapsObject

Delete AppMaps which depend on test cases that have been deleted.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/appmap/depends/test_file_inspector.rb', line 33

def clean_appmaps
  return if removed.empty?

  count = .each_with_object(0) do |, count|
     = JSON.parse(File.read())
    source_location = Util.normalize_path(['source_location'])
    appmap_path = File.join(.split('/')[0...-1])
    
    if source_location && removed.member?(source_location)
      Util.delete_appmap(appmap_path)
      count += 1
    end
  end
  count
end