aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/test-bot.rb
diff options
context:
space:
mode:
authorMartin Afanasjew2016-08-06 01:52:28 +0200
committerMartin Afanasjew2016-08-06 01:52:28 +0200
commit65203bbd1ea4513b4db3b7ed151626e1338ae70a (patch)
tree7871554addded6f19c6f33367de3b3d6591c4a1b /Library/Homebrew/dev-cmd/test-bot.rb
parent66d564d885c71d593277de6bad9db465ce0e0f7e (diff)
downloadbrew-65203bbd1ea4513b4db3b7ed151626e1338ae70a.tar.bz2
test-bot: avoid duplicate coverage reports
When running on Travis CI, both the Linux and macOS build will send a coverage report, causing them to be merged by Coveralls. This results in inferior coverage due to the early stage of the Linux-specific tests and is probably not what we want. Make sure we only send a report for macOS (assuming we stick with a single macOS build in `.travis.yml`).
Diffstat (limited to 'Library/Homebrew/dev-cmd/test-bot.rb')
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index 37b2663f2..e3ba7e41e 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -21,7 +21,8 @@
# as raw bytes instead of re-encoding in UTF-8.
# --fast: Don't install any packages, but run e.g. audit anyway.
# --keep-tmp: Keep temporary files written by main installs and tests that are run.
-# --no-pull Don't use `brew pull` when possible.
+# --no-pull: Don't use `brew pull` when possible.
+# --coverage: Generate coverage report and send it to Coveralls.
#
# --ci-master: Shortcut for Homebrew master branch CI options.
# --ci-pr: Shortcut for Homebrew pull request CI options.
@@ -661,14 +662,14 @@ module Homebrew
if @tap.nil?
tests_args = []
- tests_args_coverage = []
+ tests_args_no_compat = []
if RUBY_TWO
tests_args << "--official-cmd-taps"
- tests_args_coverage << "--coverage" if ENV["TRAVIS"]
+ tests_args_no_compat << "--coverage" if ARGV.include?("--coverage")
end
test "brew", "tests", *tests_args
test "brew", "tests", "--generic", *tests_args
- test "brew", "tests", "--no-compat", *tests_args_coverage
+ test "brew", "tests", "--no-compat", *tests_args_no_compat
test "brew", "readall", "--syntax"
# TODO: try to fix this on Linux at some stage.
if OS.mac?
@@ -929,6 +930,13 @@ module Homebrew
ARGV << "--verbose"
ARGV << "--ci-master" if ENV["TRAVIS_PULL_REQUEST"] == "false"
ENV["HOMEBREW_VERBOSE_USING_DOTS"] = "1"
+
+ # Only report coverage if build runs on macOS and this is indeed Homebrew,
+ # as we don't want this to be averaged with inferior Linux test coverage.
+ repo = ENV["TRAVIS_REPO_SLUG"]
+ if repo && repo.start_with?("Homebrew/") && ENV["OSX"]
+ ARGV << "--coverage"
+ end
end
if ARGV.include?("--ci-master") || ARGV.include?("--ci-pr") \