diff --git a/.expeditor/buildkite/coverage.sh b/.expeditor/buildkite/coverage.sh new file mode 100644 index 00000000..9da085c0 --- /dev/null +++ b/.expeditor/buildkite/coverage.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -ueo pipefail + +echo "--- system details" +uname -a +ruby -v +bundle --version + +echo "--- bundle install" +bundle install --jobs=7 --retry=3 --without tools integration + +echo "+++ bundle exec rake" +bundle exec rake + diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 17e115b8..bf5b3798 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -53,3 +53,7 @@ pipelines: - verify: description: Pull Request validation tests public: true + + - coverage: + description: Generate test coverage report + public: true diff --git a/.expeditor/coverage.pipeline.yml b/.expeditor/coverage.pipeline.yml new file mode 100644 index 00000000..2125be42 --- /dev/null +++ b/.expeditor/coverage.pipeline.yml @@ -0,0 +1,11 @@ +--- +steps: + + - label: coverage + commands: + - bundle install --jobs=7 --retry=3 --without tools integration + - bundle exec rake test:default + expeditor: + executor: + docker: + image: ruby:2.6-stretch diff --git a/test/helper.rb b/test/helper.rb index b9ae754b..6eb1f1a5 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,6 +1,15 @@ # encoding: utf-8 -require "coveralls" -Coveralls.wear! +if ENV["CI_ENABLE_COVERAGE"] + require "coveralls" + SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter, + ]) + + SimpleCov.start do + add_filter "/test/" + end +end require "minitest/autorun" require "minitest/spec"