Skip to content

Commit 840dfca

Browse files
authored
Merge pull request #152 from DavidS/codecov
Enable code coverage tracking
2 parents 59aa812 + 8364b8e commit 840dfca

5 files changed

Lines changed: 28 additions & 4 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Gemfile.lock
2525
## MODULE BUILDS
2626
**/pkg
2727

28-
## RubyMine
28+
## RubyMine
2929
/.idea/
3030

3131
## rvm/rbenv
@@ -38,3 +38,6 @@ Gemfile.lock
3838
/log/
3939
/*.gem
4040
/spec/acceptance/nodesets/
41+
42+
## local coverage results
43+
/coverage/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ matrix:
2727
- rvm: 2.1.9
2828
env: PUPPET_GEM_VERSION="~> 4" CHECK=rubocop
2929

30-
script: 'SPEC_OPTS="--format documentation" bundle exec rake $CHECK'
30+
script: 'SPEC_OPTS="--format documentation" COVERAGE="yes" bundle exec rake $CHECK'

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ else
1313
end
1414

1515
group :test do
16-
gem "rspec", "~> 3.1"
16+
gem 'codecov'
1717
gem 'mocha'
1818
gem 'puppetlabs_spec_helper'
1919
gem 'serverspec'
20+
gem 'simplecov-console'
21+
gem "rspec", "~> 3.1"
2022
end
2123

2224
group :acceptance do

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
# disable comments, info can be gotten from the pr status updates, and the comment editing spams the hipchat notifications
3+
comment: false

spec/spec_helper.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
if ENV['COVERAGE'] == 'yes'
2+
require 'simplecov'
3+
require 'simplecov-console'
4+
require 'codecov'
5+
6+
SimpleCov.formatters = [
7+
SimpleCov::Formatter::HTMLFormatter,
8+
SimpleCov::Formatter::Console,
9+
SimpleCov::Formatter::Codecov,
10+
]
11+
SimpleCov.start do
12+
track_files 'lib/**/*.rb'
13+
14+
add_filter '/spec'
15+
end
16+
end
17+
118
require 'mocha'
219
require 'rspec'
320
require 'puppet/version'
@@ -21,4 +38,3 @@
2138
YARD::Registry.clear
2239
end
2340
end
24-

0 commit comments

Comments
 (0)