Skip to content

Commit 88a5fac

Browse files
author
Laura Paakkinen
committed
Add code coverage reporting to CC
This PR add code coverage reporting and integrates it with code climate. Closes #55
1 parent 5fd4f7b commit 88a5fac

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

.travis.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1+
env:
2+
global:
3+
- CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID
4+
15
language: ruby
26
rvm:
37
- 2.2
8+
49
before_install:
510
- gem install minitest
11+
- gem install simplecov
12+
613
notifications:
714
hipchat:
815
rooms:
916
secure: S0K355wxCRxwK2cOmbcVOaQitRtIEIq0OEEW7JZp8XtooupGwpmJSm22gqeo7GR6eidqlV8Tp6SUffpLE6SvS0hed3LDbJw7oWoXA7XvRp7gh/AKvLZ0e2uz/a1WPSYy0gNS3TJ72PcyoMS6rPCKR0FyDu8mQ2sW8CpZG07NDCmJPgO+dKfnpeuEmElZoh0AZxE6u1RjvUdSzxnmCVjve621ghtMaKInd0fnNPOM6tm9L0HKSbaLI/buphYhQ/DLpO+dLvt7W2yN+9BwaGqPv7X04Sn0UVAu9+EjSouLLBVNRIsdUfgRGeooStm8/Iw0c1brY4goyYJxGs0TiPkfPeWJcNmQ68YSZLDhUGoMZWCZwGq0Lm/oThJX8K777r3qt0Td4iAXNG+bVN+1KZtZRra6B/qBKBcpTTs1p4WRfIUY9D6udwyWZMcGEOFecsyt/MRlkjdmu+zSvZsadvhvQCL+m+aUmTtlUbswXu46g5NxQrHS9UKzzPkk/3mUrO1r4HLhhuuNtn3LRMbx9WVMdidMiFaAxG99VFC0Gon//FMvpTShNrRRuNSW7EJ0V8gwpx69SticfxC88pfka/MEeY9KoZc3MJdILbpgLK5oPuFMih2F/emJP1muWnk8mjaEHqHPqnSuKRr4oqO1xbh+r2ggKW58akCe08a4TihD4rg=
1017
template:
11-
- '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
12-
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
13-
<a href="https://github.com/sendgrid/%{repository}/commits/%{commit}">View on GitHub</a>'
18+
- '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
19+
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
20+
<a href="https://github.com/sendgrid/%{repository}/commits/%{commit}">View on GitHub</a>'
1421
format: html
1522
notify: false
23+
24+
before_script:
25+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
26+
- chmod +x ./cc-test-reporter
27+
- ./cc-test-reporter before-build
28+
1629
script:
17-
- rake
30+
- rake
31+
32+
after_script:
33+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

ruby_http_client.gemspec

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ Gem::Specification.new do |spec|
1717
spec.require_paths = ['lib']
1818

1919
spec.add_development_dependency 'rake', '~> 0'
20+
spec.add_development_dependency 'simplecov', '~> 0'
2021
end

test/test_helper.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if ENV['CI'] == 'true'
2+
require 'simplecov'
3+
SimpleCov.start
4+
end
5+

test/test_ruby_http_client.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require './test/test_helper'
12
require 'ruby_http_client'
23
require 'minitest/autorun'
34

0 commit comments

Comments
 (0)