File tree Expand file tree Collapse file tree 3 files changed +9
-36
lines changed Expand file tree Collapse file tree 3 files changed +9
-36
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ branches:
14
14
matrix :
15
15
include :
16
16
- rvm : 2.4.3
17
- env : PUPPET_GEM_VERSION='~> 5' COVERAGE =yes # 5.5
18
- - env : RVM="jruby-1.7.26" PUPPET_GEM_VERSION='~> 5' JRUBY_OPTS="--debug" COVERAGE =yes
17
+ env : PUPPET_GEM_VERSION='~> 5' SIMPLECOV =yes # 5.5
18
+ - env : RVM="jruby-1.7.26" PUPPET_GEM_VERSION='~> 5' JRUBY_OPTS="--debug" SIMPLECOV =yes
19
19
before_cache : pushd ~/.rvm && rm -rf archives rubies/ruby-2.2.7 rubies/ruby-2.3.4 && popd
20
20
cache :
21
21
bundler : true
@@ -45,7 +45,7 @@ matrix:
45
45
- rvm : 2.4.1
46
46
env : PUPPET_GEM_VERSION='~> 5.0.0'
47
47
- rvm : 2.1.9
48
- env : PUPPET_GEM_VERSION='~> 4' COVERAGE =yes # 4.10
48
+ env : PUPPET_GEM_VERSION='~> 4' SIMPLECOV =yes # 4.10
49
49
- rvm : 2.1.9
50
50
env : PUPPET_GEM_VERSION='~> 4.9.0'
51
51
- rvm : 2.1.9
Original file line number Diff line number Diff line change 27
27
namespace :spec do
28
28
desc 'Run RSpec code examples with coverage collection'
29
29
task :coverage do
30
- ENV [ 'COVERAGE ' ] = 'yes'
30
+ ENV [ 'SIMPLECOV ' ] = 'yes'
31
31
Rake ::Task [ 'spec' ] . execute
32
32
end
33
33
end
Original file line number Diff line number Diff line change 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 'lib/puppet/resource_api/version.rb'
15
-
16
- add_filter '/spec'
17
-
18
- # do not track vendored files
19
- add_filter '/vendor'
20
- add_filter '/.vendor'
21
-
22
- # do not track gitignored files
23
- # this adds about 4 seconds to the coverage check
24
- # this could definitely be optimized
25
- add_filter do |f |
26
- # system returns true if exit status is 0, which with git-check-ignore means file is ignored
27
- system ( "git check-ignore --quiet #{ f . filename } " )
28
- end
29
- end
30
- end
31
-
32
1
require 'bundler/setup'
33
- require 'puppet/resource_api'
34
2
35
3
RSpec . configure do |config |
36
4
# Enable flags like --only-failures and --next-failure
47
15
config . mock_with :rspec
48
16
end
49
17
18
+ # load puppet spec support and coverage setup before loading our code
50
19
require 'puppetlabs_spec_helper/module_spec_helper'
20
+ require 'puppet/resource_api'
21
+
22
+ # exclude the `version.rb` which already gets loaded by bundler via the gemspec, and doesn't need coverage testing anyways.
23
+ SimpleCov . add_filter 'lib/puppet/resource_api/version.rb'
You can’t perform that action at this time.
0 commit comments