Skip to content

Commit

Permalink
Update .travis.yml to send test coverage (#9)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Cruikshanks committed Jun 12, 2019
1 parent cf82284 commit 0c25a93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 1 addition & 5 deletions spec/support/simplecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0c25a93

Please sign in to comment.