test-bot: make master builds faster.

Just do a few things rather than doing e.g. a full compile.

Closes Homebrew/homebrew#44936.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2015-10-14 13:53:24 +01:00
parent 3d585d6e3f
commit 667fa65be8

View File

@ -10,7 +10,6 @@
# --skip-homebrew: Don't check Homebrew's files and tests are all valid. # --skip-homebrew: Don't check Homebrew's files and tests are all valid.
# --junit: Generate a JUnit XML test results file. # --junit: Generate a JUnit XML test results file.
# --email: Generate an email subject file. # --email: Generate an email subject file.
# --no-bottle: Run brew install without --build-bottle
# --keep-old: Run brew bottle --keep-old to build new bottles for a single platform. # --keep-old: Run brew bottle --keep-old to build new bottles for a single platform.
# --HEAD: Run brew install with --HEAD # --HEAD: Run brew install with --HEAD
# --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/ # --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/
@ -18,6 +17,7 @@
# --dry-run: Just print commands, don't run them. # --dry-run: Just print commands, don't run them.
# --fail-fast: Immediately exit on a failing step. # --fail-fast: Immediately exit on a failing step.
# --verbose: Print out all logs in realtime # --verbose: Print out all logs in realtime
# --fast: Don't install any packages but run e.g. audit anyway.
# #
# --ci-master: Shortcut for Homebrew master branch CI options. # --ci-master: Shortcut for Homebrew master branch CI options.
# --ci-pr: Shortcut for Homebrew pull request CI options. # --ci-pr: Shortcut for Homebrew pull request CI options.
@ -547,35 +547,41 @@ module Homebrew
test "brew", "postinstall", *changed_dependences test "brew", "postinstall", *changed_dependences
end end
formula_fetch_options = [] formula_fetch_options = []
formula_fetch_options << "--build-bottle" unless ARGV.include? "--no-bottle"
formula_fetch_options << "--force" if ARGV.include? "--cleanup" formula_fetch_options << "--force" if ARGV.include? "--cleanup"
formula_fetch_options << canonical_formula_name formula_fetch_options << canonical_formula_name
test "brew", "fetch", "--retry", *formula_fetch_options test "brew", "fetch", "--retry", *formula_fetch_options
test "brew", "uninstall", "--force", canonical_formula_name if formula.installed? test "brew", "uninstall", "--force", canonical_formula_name if formula.installed?
install_args = ["--verbose"] install_args = ["--verbose"]
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
install_args << "--HEAD" if ARGV.include? "--HEAD" install_args << "--HEAD" if ARGV.include? "--HEAD"
# Pass --devel or --HEAD to install in the event formulae lack stable. Supports devel-only/head-only. # Pass --devel or --HEAD to install in the event formulae lack stable. Supports devel-only/head-only.
# head-only should not have devel, but devel-only can have head. Stable can have all three. # head-only should not have devel, but devel-only can have head. Stable can have all three.
if devel_only_tap? formula if devel_only_tap? formula
install_args << "--devel" install_args << "--devel"
formula_bottled = false
elsif head_only_tap? formula elsif head_only_tap? formula
install_args << "--HEAD" install_args << "--HEAD"
formula_bottled = false
else
formula_bottled = formula.bottled?
end end
install_args << canonical_formula_name install_args << canonical_formula_name
# Don't care about e.g. bottle failures for dependencies. # Don't care about e.g. bottle failures for dependencies.
run_as_not_developer do run_as_not_developer do
test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty? if !ARGV.include?("--fast") || formula_bottled
test "brew", "install", *install_args test "brew", "install", "--only-dependencies", *install_args unless dependencies.empty?
test "brew", "install", *install_args
install_passed = steps.last.passed?
else
install_passed = false
end
end end
install_passed = steps.last.passed?
audit_args = [canonical_formula_name] audit_args = [canonical_formula_name]
audit_args << "--strict" << "--online" if @added_formulae.include? formula_name audit_args << "--strict" << "--online" if @added_formulae.include? formula_name
test "brew", "audit", *audit_args test "brew", "audit", *audit_args
if install_passed if install_passed
if formula.stable? && !ARGV.include?("--no-bottle") if formula.stable? && !ARGV.include?("--fast")
bottle_args = ["--verbose", "--rb", canonical_formula_name] bottle_args = ["--verbose", "--rb", canonical_formula_name]
bottle_args << "--keep-old" if ARGV.include? "--keep-old" bottle_args << "--keep-old" if ARGV.include? "--keep-old"
test "brew", "bottle", *bottle_args test "brew", "bottle", *bottle_args
@ -610,7 +616,8 @@ module Homebrew
test "brew", "uninstall", "--force", canonical_formula_name test "brew", "uninstall", "--force", canonical_formula_name
end end
if formula.devel && formula.stable? && !ARGV.include?("--HEAD") \ if formula.devel && formula.stable? \
&& !ARGV.include?("--HEAD") && !ARGV.include?("--fast") \
&& satisfied_requirements?(formula, :devel) && satisfied_requirements?(formula, :devel)
test "brew", "fetch", "--retry", "--devel", *formula_fetch_options test "brew", "fetch", "--retry", "--devel", *formula_fetch_options
run_as_not_developer { test "brew", "install", "--devel", "--verbose", canonical_formula_name } run_as_not_developer { test "brew", "install", "--devel", "--verbose", canonical_formula_name }
@ -883,7 +890,7 @@ module Homebrew
ARGV << "--junit" << "--local" ARGV << "--junit" << "--local"
end end
if ARGV.include? "--ci-master" if ARGV.include? "--ci-master"
ARGV << "--no-bottle" << "--email" ARGV << "--email" << "--fast"
end end
if ARGV.include? "--local" if ARGV.include? "--local"