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:
88 include :
99 # Build with latest ruby
1010 - 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"
1212 - 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"
1414 - 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"
1616 # Build with older ruby versions
1717 - rvm : 2.4
1818 env : RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="3.8.7"
Original file line number Diff line number Diff line change 3737 s . add_development_dependency 'rubocop' , '= 0.48.1'
3838
3939 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 '
4141
4242 puppet_version = ENV [ 'PUPPET_VERSION' ] || DEFAULT_PUPPET_VERSION
4343 s . add_development_dependency 'puppet' , "~> #{ puppet_version } "
Original file line number Diff line number Diff line change 6969if [ " $RSPEC_TEST " = " true" ]; then
7070 SAVED_PATH=" $PATH "
7171 RSPEC_EXITCODE=" 0"
72+ COVERAGE_EXITCODE=" 0"
7273 for pv in $PUPPET_VERSIONS ; do
7374 export PUPPET_VERSION=" $pv "
7475
@@ -105,7 +106,12 @@ if [ "$RSPEC_TEST" = "true" ]; then
105106 if [ " $exitcode " -ne 0 ]; then RSPEC_EXITCODE=" $exitcode " ; fi
106107
107108 # 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
109115 echo " "
110116
111117 # To avoid travis getting hung if it gets confused, we'll run each of these
@@ -136,11 +142,19 @@ if [ "$RSPEC_TEST" = "true" ]; then
136142 rm -f " ${DIR} /.puppet_version"
137143else
138144 RSPEC_EXITCODE=-1
145+ COVERAGE_EXITCODE=-1
139146 echo " "
140147fi
141148
142149# Finish off script
143150echo " 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 77# Enable SimpleCov coverage testing?
88if ENV [ 'COVERAGE' ]
99 require 'simplecov'
10- require 'simplecov-json '
10+ require 'simplecov-erb '
1111 SimpleCov . formatters = [
1212 SimpleCov ::Formatter ::HTMLFormatter ,
13- SimpleCov ::Formatter ::JSONFormatter
13+ SimpleCov ::Formatter ::ERBFormatter
1414 ]
1515 SimpleCov . start do
1616 # don't show specs as missing coverage for themselves
You can’t perform that action at this time.
0 commit comments