Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ matrix:
include:
# Build with latest ruby
- rvm: 2.5
env: RUBOCOP_TEST="true" RSPEC_TEST="true" PUPPET_VERSIONS="3.8.7"
env: RUBOCOP_TEST="false" RSPEC_TEST="true" ENFORCE_COVERAGE="true" PUPPET_VERSIONS="3.8.7"
- rvm: 2.5
env: RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="4.10.8"
env: RUBOCOP_TEST="false" RSPEC_TEST="true" ENFORCE_COVERAGE="true" PUPPET_VERSIONS="4.10.8"
- rvm: 2.5
env: RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="5.0.0"
env: RUBOCOP_TEST="true" RSPEC_TEST="true" ENFORCE_COVERAGE="true" PUPPET_VERSIONS="5.0.0"
# Build with older ruby versions
- rvm: 2.4
env: RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="3.8.7"
Expand Down
2 changes: 1 addition & 1 deletion octocatalog-diff.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ EOF
s.add_development_dependency 'rubocop', '= 0.48.1'

s.add_development_dependency 'simplecov', '~> 0.14.1'
s.add_development_dependency 'simplecov-json'
s.add_development_dependency 'simplecov-erb', '~> 0.1.1'

puppet_version = ENV['PUPPET_VERSION'] || DEFAULT_PUPPET_VERSION
s.add_development_dependency 'puppet', "~> #{puppet_version}"
Expand Down
22 changes: 18 additions & 4 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ fi
if [ "$RSPEC_TEST" = "true" ]; then
SAVED_PATH="$PATH"
RSPEC_EXITCODE="0"
COVERAGE_EXITCODE="0"
for pv in $PUPPET_VERSIONS ; do
export PUPPET_VERSION="$pv"

Expand Down Expand Up @@ -105,7 +106,12 @@ if [ "$RSPEC_TEST" = "true" ]; then
if [ "$exitcode" -ne 0 ]; then RSPEC_EXITCODE="$exitcode"; fi

# Quick coverage report
"$DIR/script/display-coverage-report" "$DIR/coverage/coverage.json"
cat "$DIR/coverage/coverage.txt"
if grep -q "100% test coverage. You're all set, friend" "$DIR/coverage/coverage.txt"; then
:
else
COVERAGE_EXITCODE=1
fi
echo ""

# To avoid travis getting hung if it gets confused, we'll run each of these
Expand Down Expand Up @@ -136,11 +142,19 @@ if [ "$RSPEC_TEST" = "true" ]; then
rm -f "${DIR}/.puppet_version"
else
RSPEC_EXITCODE=-1
COVERAGE_EXITCODE=-1
echo ""
fi

# Finish off script
echo "Finished script/cibuild:"
[ "$RUBOCOP_EXITCODE" -ge 0 ] && echo " - rubocop: exit ${RUBOCOP_EXITCODE}"
[ "$RSPEC_EXITCODE" -ge 0 ] && echo " - rspec: exit ${RSPEC_EXITCODE}"
if [ "$RUBOCOP_EXITCODE" -gt 0 ] || [ "$RSPEC_EXITCODE" -gt 0 ]; then exit 1; else exit 0; fi
[ "$RUBOCOP_EXITCODE" -ge 0 ] && echo " - rubocop: exit ${RUBOCOP_EXITCODE}"
[ "$RSPEC_EXITCODE" -ge 0 ] && echo " - rspec: exit ${RSPEC_EXITCODE}"
[ "$COVERAGE_EXITCODE" -ge 0 ] && echo " - coverage: exit ${COVERAGE_EXITCODE}"
if [ "$RUBOCOP_EXITCODE" -gt 0 ] || [ "$RSPEC_EXITCODE" -gt 0 ]; then
exit 1
fi
if [ "$COVERAGE_EXITCODE" -gt 0 ] && [ "$ENFORCE_COVERAGE" == "true" ]; then
exit 1
fi
exit 0
51 changes: 0 additions & 51 deletions script/display-coverage-report

This file was deleted.

4 changes: 2 additions & 2 deletions spec/octocatalog-diff/tests/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# Enable SimpleCov coverage testing?
if ENV['COVERAGE']
require 'simplecov'
require 'simplecov-json'
require 'simplecov-erb'
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::JSONFormatter
SimpleCov::Formatter::ERBFormatter
]
SimpleCov.start do
# don't show specs as missing coverage for themselves
Expand Down
Binary file added vendor/cache/simplecov-erb-0.1.1.gem
Binary file not shown.
Binary file removed vendor/cache/simplecov-json-0.2.gem
Binary file not shown.