File tree Expand file tree Collapse file tree 7 files changed +24
-61
lines changed
spec/octocatalog-diff/tests Expand file tree Collapse file tree 7 files changed +24
-61
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ matrix:
8
8
include :
9
9
# Build with latest ruby
10
10
- rvm : 2.5
11
- env : RUBOCOP_TEST="true " RSPEC_TEST="true" PUPPET_VERSIONS="3.8.7"
11
+ env : RUBOCOP_TEST="false " RSPEC_TEST="true" ENFORCE_COVERAGE ="true" PUPPET_VERSIONS="3.8.7"
12
12
- rvm : 2.5
13
- env : RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="4.10.8"
13
+ env : RUBOCOP_TEST="false" RSPEC_TEST="true" ENFORCE_COVERAGE="true" PUPPET_VERSIONS="4.10.8"
14
14
- rvm : 2.5
15
- env : RUBOCOP_TEST="false " RSPEC_TEST="true" PUPPET_VERSIONS="5.0.0"
15
+ env : RUBOCOP_TEST="true " RSPEC_TEST="true" ENFORCE_COVERAGE ="true" PUPPET_VERSIONS="5.0.0"
16
16
# Build with older ruby versions
17
17
- rvm : 2.4
18
18
env : RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="3.8.7"
Original file line number Diff line number Diff line change 37
37
s . add_development_dependency 'rubocop' , '= 0.48.1'
38
38
39
39
s . add_development_dependency 'simplecov' , '~> 0.14.1'
40
- s . add_development_dependency 'simplecov-json '
40
+ s . add_development_dependency 'simplecov-erb' , '~> 0.1.1 '
41
41
42
42
puppet_version = ENV [ 'PUPPET_VERSION' ] || DEFAULT_PUPPET_VERSION
43
43
s . add_development_dependency 'puppet' , "~> #{ puppet_version } "
Original file line number Diff line number Diff line change 69
69
if [ " $RSPEC_TEST " = " true" ]; then
70
70
SAVED_PATH=" $PATH "
71
71
RSPEC_EXITCODE=" 0"
72
+ COVERAGE_EXITCODE=" 0"
72
73
for pv in $PUPPET_VERSIONS ; do
73
74
export PUPPET_VERSION=" $pv "
74
75
@@ -105,7 +106,12 @@ if [ "$RSPEC_TEST" = "true" ]; then
105
106
if [ " $exitcode " -ne 0 ]; then RSPEC_EXITCODE=" $exitcode " ; fi
106
107
107
108
# Quick coverage report
108
- " $DIR /script/display-coverage-report" " $DIR /coverage/coverage.json"
109
+ cat " $DIR /coverage/coverage.txt"
110
+ if grep -q " 100% test coverage. You're all set, friend" " $DIR /coverage/coverage.txt" ; then
111
+ :
112
+ else
113
+ COVERAGE_EXITCODE=1
114
+ fi
109
115
echo " "
110
116
111
117
# To avoid travis getting hung if it gets confused, we'll run each of these
@@ -136,11 +142,19 @@ if [ "$RSPEC_TEST" = "true" ]; then
136
142
rm -f " ${DIR} /.puppet_version"
137
143
else
138
144
RSPEC_EXITCODE=-1
145
+ COVERAGE_EXITCODE=-1
139
146
echo " "
140
147
fi
141
148
142
149
# Finish off script
143
150
echo " Finished script/cibuild:"
144
- [ " $RUBOCOP_EXITCODE " -ge 0 ] && echo " - rubocop: exit ${RUBOCOP_EXITCODE} "
145
- [ " $RSPEC_EXITCODE " -ge 0 ] && echo " - rspec: exit ${RSPEC_EXITCODE} "
146
- if [ " $RUBOCOP_EXITCODE " -gt 0 ] || [ " $RSPEC_EXITCODE " -gt 0 ]; then exit 1; else exit 0; fi
151
+ [ " $RUBOCOP_EXITCODE " -ge 0 ] && echo " - rubocop: exit ${RUBOCOP_EXITCODE} "
152
+ [ " $RSPEC_EXITCODE " -ge 0 ] && echo " - rspec: exit ${RSPEC_EXITCODE} "
153
+ [ " $COVERAGE_EXITCODE " -ge 0 ] && echo " - coverage: exit ${COVERAGE_EXITCODE} "
154
+ if [ " $RUBOCOP_EXITCODE " -gt 0 ] || [ " $RSPEC_EXITCODE " -gt 0 ]; then
155
+ exit 1
156
+ fi
157
+ if [ " $COVERAGE_EXITCODE " -gt 0 ] && [ " $ENFORCE_COVERAGE " == " true" ]; then
158
+ exit 1
159
+ fi
160
+ exit 0
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 7
7
# Enable SimpleCov coverage testing?
8
8
if ENV [ 'COVERAGE' ]
9
9
require 'simplecov'
10
- require 'simplecov-json '
10
+ require 'simplecov-erb '
11
11
SimpleCov . formatters = [
12
12
SimpleCov ::Formatter ::HTMLFormatter ,
13
- SimpleCov ::Formatter ::JSONFormatter
13
+ SimpleCov ::Formatter ::ERBFormatter
14
14
]
15
15
SimpleCov . start do
16
16
# don't show specs as missing coverage for themselves
You can’t perform that action at this time.
0 commit comments