Cleanup Travis and CI configuration.

Use the environment variables set by `brew test-bot`. Eventually we'll
disable Travis CI running CodeCov so move `TRAVIS` references to
`HOMEBREW_TRAVIS_CI` so it doesn't need whitelisted.

Also, fix `azure-pipelines.yml` so it's testing the correct version of
Homebrew/brew (the one checked out in the `pwd`).
This commit is contained in:
Mike McQuaid 2018-09-19 14:45:06 +01:00
parent d8f53486f5
commit 59c858a8e8
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
5 changed files with 25 additions and 11 deletions

View File

@ -74,7 +74,7 @@ module Homebrew
# `brew test-bot` runs `brew doctor` in the CI for the Homebrew/brew
# repository. This only needs to support whatever CI provider
# Homebrew/brew is currently using.
return if ENV["TRAVIS"]
return if ENV["HOMEBREW_TRAVIS_CI"]
message = <<~EOS
Your Xcode (#{MacOS::Xcode.version}) is outdated.
@ -101,7 +101,7 @@ module Homebrew
# `brew test-bot` runs `brew doctor` in the CI for the Homebrew/brew
# repository. This only needs to support whatever CI provider
# Homebrew/brew is currently using.
return if ENV["TRAVIS"]
return if ENV["HOMEBREW_TRAVIS_CI"]
<<~EOS
A newer Command Line Tools release is available.

View File

@ -729,7 +729,7 @@ class FormulaInstaller
Utils.safe_fork do
# Invalidate the current sudo timestamp in case a build script calls sudo.
# Travis CI's Linux sudoless workers have a weird sudo that fails here.
system "/usr/bin/sudo", "-k" unless ENV["TRAVIS_SUDO"] == "false"
system "/usr/bin/sudo", "-k" if ENV["HOMEBREW_TRAVIS_SUDO"] != "false"
if Sandbox.formula?(formula)
sandbox = Sandbox.new

View File

@ -1,10 +1,14 @@
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
if ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
formatters = [SimpleCov::Formatter::HTMLFormatter]
if ENV["HOMEBREW_CODECOV_TOKEN"] || ENV["HOMEBREW_TRAVIS_CI"]
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
formatters << SimpleCov::Formatter::Codecov
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
end
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
end
require "rspec/its"

View File

@ -32,7 +32,7 @@ def curl_args(*extra_args, show_output: false, user_agent: :default)
args << "--fail"
args << "--progress-bar" unless ARGV.verbose?
args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"]
args << "--silent" if !$stdout.tty? || ENV["TRAVIS"]
args << "--silent" if !$stdout.tty? || ENV["HOMEBREW_TRAVIS_CI"]
end
args + extra_args

View File

@ -4,18 +4,28 @@ jobs:
vmImage: xcode9-macos10.13
steps:
- bash: |
rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask*
brew update-reset
brew test-bot
displayName: brew test-bot
HOMEBREW_REPOSITORY="$(brew --repo)";
mv "$HOMEBREW_REPOSITORY/Library/Taps" "$PWD/Library";
sudo rm -rf "$HOMEBREW_REPOSITORY";
sudo ln -s "$PWD" "$HOMEBREW_REPOSITORY";
brew update-reset Library/Taps/homebrew/homebrew-core
brew test-bot --coverage
displayName: Run brew test-bot
env:
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)
- task: PublishTestResults@2
displayName: Publish test-bot test results
inputs:
testRunner: JUnit
testResultsFiles: brew-test-bot.xml
- job: Linux
pool:
vmImage: ubuntu-16.04
steps:
- bash: |
"$PWD/bin/brew" test-bot
displayName: brew test-bot
displayName: Run brew test-bot
env:
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)