diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index e76dd76279..b3dfa3beca 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -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. diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index dd6f583110..22f81166ac 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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 diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index c084b1e551..e34bc3a78f 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -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" diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 8df5615d4b..6917cc1923 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0267fc726e..eb3a05522b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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)