Use Coveralls for coverage reporting.

This commit is contained in:
Mike McQuaid 2018-12-30 20:06:13 +00:00
parent 438939cea5
commit 0de21812a7
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
7 changed files with 31 additions and 57 deletions

3
.gitignore vendored
View File

@ -119,9 +119,8 @@
/docs/.jekyll-metadata
# Unignore our root-level metadata files.
!/.editorconfig
!/.gitignore
!/.travis.yml
!/.codecov.yml
!/.yardopts
!/CHANGELOG.md
!/CODE_OF_CONDUCT.md

View File

@ -1,33 +0,0 @@
language: ruby
rvm: system
os: osx
osx_image: xcode10
cache:
directories:
- $HOME/Library/Caches/Homebrew/style
- $HOME/Library/Caches/Homebrew/tests
- Library/Homebrew/vendor/bundle
branches:
only:
- master
env:
- HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1
before_install:
- HOMEBREW_REPOSITORY="$(brew --repo)"
- sudo chown -R "$USER" "$HOMEBREW_REPOSITORY"
# trigger vendored ruby installation
- brew help
- mv "$HOMEBREW_REPOSITORY/Library/Taps" "$PWD/Library"
- sudo rm -rf "$HOMEBREW_REPOSITORY"
- sudo ln -s "$PWD" "$HOMEBREW_REPOSITORY"
- travis_retry git clone --depth=1 https://github.com/Homebrew/homebrew-test-bot Library/Taps/homebrew/homebrew-test-bot
script:
- travis_wait 60 brew test-bot
notifications:
slack: machomebrew:1XNF7p1JRCdBUuKaeSwsWEc1

View File

@ -1,10 +0,0 @@
comment: off
fixes:
- "::Library/Homebrew/"
coverage:
round: nearest
precision: 2
status:
project:
default:
threshold: 0.05%

View File

@ -12,7 +12,7 @@ group :development do
end
group :coverage do
gem "codecov", require: false
gem "coveralls", require: false
gem "simplecov", require: false
gem "simplecov-cobertura", require: false
end

View File

@ -2,10 +2,12 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.0)
codecov (0.1.14)
json
simplecov
url
coveralls (0.8.22)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
tins (~> 1.6)
diff-lcs (1.3)
docile (1.3.1)
hpricot (0.8.6)
@ -60,14 +62,17 @@ GEM
simplecov-cobertura (1.3.0)
simplecov (~> 0.8)
simplecov-html (0.10.2)
term-ansicolor (1.7.0)
tins (~> 1.0)
thor (0.19.4)
tins (1.20.2)
unicode-display_width (1.4.1)
url (0.3.2)
PLATFORMS
ruby
DEPENDENCIES
codecov
coveralls
parallel_tests
ronn
rspec

View File

@ -2,10 +2,22 @@ if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
formatters = [SimpleCov::Formatter::HTMLFormatter]
if ENV["HOMEBREW_CODECOV_TOKEN"] || ENV["HOMEBREW_TRAVIS_CI"]
require "codecov"
formatters << SimpleCov::Formatter::Codecov
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
if ENV["HOMEBREW_COVERALLS_REPO_TOKEN"] || ENV["HOMEBREW_TRAVIS_CI"]
require "coveralls"
if !ENV["HOMEBREW_COLOR"] && (ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty?)
Coveralls::Output.no_color
end
formatters << Coveralls::SimpleCov::Formatter
ENV["CI_NAME"] = ENV["HOMEBREW_CI_NAME"]
ENV["CI_JOB_ID"] = ENV["TEST_ENV_NUMBER"] || "1"
ENV["CI_BUILD_NUMBER"] = ENV["HOMEBREW_CI_BUILD_NUMBER"]
ENV["CI_BUILD_URL"] = ENV["HOMEBREW_CI_BUILD_URL"]
ENV["CI_BRANCH"] = ENV["HOMEBREW_CI_BRANCH"]
ENV["CI_PULL_REQUEST"] = ENV["HOMEBREW_CI_PULL_REQUEST"]
ENV["COVERALLS_REPO_TOKEN"] = ENV["HOMEBREW_COVERALLS_REPO_TOKEN"]
end
if ENV["HOMEBREW_AZURE_PIPELINES"]

View File

@ -10,10 +10,11 @@ jobs:
sudo rm -rf "$HOMEBREW_REPOSITORY"
sudo ln -s "$PWD" "$HOMEBREW_REPOSITORY"
brew update-reset Library/Taps/homebrew/homebrew-core
brew test-bot --coverage
brew test-bot
displayName: Run brew test-bot
env:
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)
HOMEBREW_COVERALLS_REPO_TOKEN: $(coveralls.homebrewBrewApiToken)
- task: PublishTestResults@2
displayName: Publish test-bot test results