From 0c25a938b94bb36a6dc9def6fe3cfb24988be029 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Wed, 12 Jun 2019 16:19:32 +0100 Subject: [PATCH] Update .travis.yml to send test coverage (#9) This changes updates the format of the travis.yml to match our general format, as well as ensuring it is configured to send test coverage stats to codeclimate. It also makes a tweak to the `simplecov.rb` rspec support file because we noted that coverage wasn't working. We had used this config in other repos and still been able to generate coverage, however in this repo it causes simplecov to return LOC 0 with a coverage score of 100%! This took way too much time to track down, so we are simply blitzing the offending line and moving on. --- .travis.yml | 9 ++++++++- spec/support/simplecov.rb | 6 +----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26d0cfd..e0ee699 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,20 @@ +env: + global: + - CC_TEST_REPORTER_ID=9a0d95efc12238c195685a08da6071e41d25bf6475723adf8f419095b56e0ac5 + language: ruby rvm: 2.4.2 cache: bundler # Travis CI clones repositories to a depth of 50 commits, which is only really # useful if you are performing git operations. -# https://docs.travis-ci.com/user/customizing-the-build/#git-clone-depth +# https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth git: depth: 3 +before_install: + - export TZ=UTC + before_script: # Setup to support the CodeClimate test coverage submission # As per CodeClimate's documentation, they suggest only running diff --git a/spec/support/simplecov.rb b/spec/support/simplecov.rb index 140291e..0d7e1d9 100644 --- a/spec/support/simplecov.rb +++ b/spec/support/simplecov.rb @@ -7,11 +7,7 @@ # This gives us the most accurate assessment of our unit test coverage # https://github.com/colszowka/simplecov#getting-started SimpleCov.start do - # We filter the spec folder, mainly to ensure that any dummy apps don't get - # included in the coverage report. However our intent is that nothing in the - # spec folder should be included - add_filter "/spec/" # The version file is simply just that, so we do not feel the need to ensure # we have a test for it - add_filter "lib/defra_ruby/validators/version" + add_filter "lib/defra_ruby/aws/version" end