From d9dfc8c14ccb2e6f221679fd5ea134aa6a9c5abe Mon Sep 17 00:00:00 2001 From: JR Richardson Date: Tue, 28 Apr 2015 10:31:57 -0600 Subject: [PATCH] Do not format coverage result when exiting forked process --- lib/code_climate/test_reporter.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/code_climate/test_reporter.rb b/lib/code_climate/test_reporter.rb index 1724ee5..fdd3285 100644 --- a/lib/code_climate/test_reporter.rb +++ b/lib/code_climate/test_reporter.rb @@ -3,12 +3,18 @@ module TestReporter def self.start if run? + test_runner_pid = Process.pid require "simplecov" ::SimpleCov.add_filter 'vendor' ::SimpleCov.formatter = Formatter ::SimpleCov.start(configuration.profile) do skip_token CodeClimate::TestReporter.configuration.skip_token end + ::SimpleCov.at_exit do + if test_runner_pid == Process.pid + ::SimpleCov.result.format! + end + end end end