File tree 4 files changed +41
-4
lines changed 4 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
+ .gitlab-ci.yml :
3
+ unmanaged : true
4
+
2
5
.travis.yml :
3
6
docker_sets :
4
7
- set : docker/centos-7
@@ -38,9 +41,6 @@ Gemfile:
38
41
version : ' ~> 1.3'
39
42
condition : ENV['GEM_BOLT']
40
43
41
- .gitlab-ci.yml :
42
- unmanaged : true
43
-
44
44
Rakefile :
45
45
extras : |
46
46
# The beaker task requires the test fixtures created by the spec_prep task
@@ -51,3 +51,7 @@ Rakefile:
51
51
spec_prep = Rake::Task['spec_prep']
52
52
beaker_task.enhance(beaker_task.prerequisite_tasks << spec_prep)
53
53
end
54
+
55
+ spec/spec_helper.rb :
56
+ mock_with : ' :rspec'
57
+ coverage_report : true
Original file line number Diff line number Diff line change 67
67
"description" : " Tasks that manipulate a service" ,
68
68
"pdk-version" : " 1.9.0" ,
69
69
"template-url" : " https://github.com/puppetlabs/pdk-templates/" ,
70
- "template-ref" : " 1.9.0 -0-g7281db5 "
70
+ "template-ref" : " heads/master -0-g615413e "
71
71
}
Original file line number Diff line number Diff line change
1
+ RSpec . configure do |c |
2
+ c . mock_with :rspec
3
+ end
4
+
1
5
require 'puppetlabs_spec_helper/module_spec_helper'
2
6
require 'rspec-puppet-facts'
3
7
34
38
end
35
39
c . filter_run_excluding ( bolt : true ) unless ENV [ 'GEM_BOLT' ]
36
40
c . after ( :suite ) do
41
+ RSpec ::Puppet ::Coverage . report! ( 0 )
37
42
end
38
43
end
39
44
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 '/spec'
15
+
16
+ # do not track vendored files
17
+ add_filter '/vendor'
18
+ add_filter '/.vendor'
19
+
20
+ # do not track gitignored files
21
+ # this adds about 4 seconds to the coverage check
22
+ # this could definitely be optimized
23
+ add_filter do |f |
24
+ # system returns true if exit status is 0, which with git-check-ignore means file is ignored
25
+ system ( "git check-ignore --quiet #{ f . filename } " )
26
+ end
27
+ end
28
+ end
You can’t perform that action at this time.
0 commit comments