Module: CIQuantum::Utils::CoverageMerger

Defined in:
lib/ciquantum/utils/coverage_merger.rb

Class Method Summary collapse

Class Method Details

.merge(*child_project_paths) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/ciquantum/utils/coverage_merger.rb', line 7

def self.merge *child_project_paths
  coverage = {}
  child_project_paths.each do |path|
    resultset = JSON.parse File.read(File.join path, "coverage/.resultset.json")
    resultset.each do |key, value|
      coverage = value["coverage"].merge_resultset coverage
    end
  end

  merged_result = ::SimpleCov::Result.from_hash({"Combined" => { "coverage" => coverage, "timestamp" => Time.now.to_i }})
  ::SimpleCov::ResultMerger.store_result merged_result
end