From 62ef5db39dcf9e69a6793f50d7f9e887865d8c65 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 3 Jan 2018 15:37:00 -0600 Subject: [PATCH] Invoke CodeClimate and Simplecov from the test helper Moves them out of the rake task so that we can: - Get coverage information locally - Get reporting of coverage and code climate at the unit test level Having it at the CI level was nice to get explicit coverage for both cucumber and the test suite but it doesn't work if the test suite doesn't run at all. --- test/test_helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 1bcfcdb4..fcfb2d7f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -10,6 +10,14 @@ require 'rails/test_help' "time_zone" => "Amsterdam" # force UTC+1 so Travis triggers time zone failures }.inject( SITE_CONFIG ) { |h, elem| h[elem[0]] = elem[1]; h } +if ENV["COVERAGE"] + require "codeclimate-test-reporter" + CodeClimate::TestReporter.start + + require 'simplecov' + SimpleCov.start 'rails' +end + class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. #