Skip to content

Commit

Permalink
Merge pull request #486 from inspec/mj/bk-coverage
Browse files Browse the repository at this point in the history
Remove coverage from general test runs and add its own pipeline
  • Loading branch information
miah authored Jul 23, 2019
2 parents 1af7911 + 2a12b70 commit 43420f6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .expeditor/buildkite/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/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"
export CI_NAME=Buildkite
export CI_BUILD_NUMBER=$BUILDKITE_BUILD_NUMBER
export CI_BUILD_URL=$BUILDKITE_BUILD_URL
export CI_BRANCH=$BUILDKITE_BRANCH

bundle exec rake

6 changes: 6 additions & 0 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ pipelines:
- verify:
description: Pull Request validation tests
public: true

- coverage:
description: Generate test coverage report
public: true
env:
- CI_ENABLE_COVERAGE: true
11 changes: 11 additions & 0 deletions .expeditor/coverage.pipeline.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 11 additions & 2 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 43420f6

Please sign in to comment.