test-bot: add --skip-relocation flag

Closes #410.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2016-06-28 20:58:44 +08:00
parent d4e8d3df0a
commit 91a225eef1
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE

View File

@ -3,23 +3,24 @@
# Usage: brew test-bot [options...] <pull-request|formula> # Usage: brew test-bot [options...] <pull-request|formula>
# #
# Options: # Options:
# --keep-logs: Write and keep log files under ./brewbot/. # --keep-logs: Write and keep log files under ./brewbot/.
# --cleanup: Clean the Homebrew directory. Very dangerous. Use with care. # --cleanup: Clean the Homebrew directory. Very dangerous. Use with care.
# --clean-cache: Remove all cached downloads. Use with care. # --clean-cache: Remove all cached downloads. Use with care.
# --skip-setup: Don't check the local system is setup correctly. # --skip-setup: Don't check the local system is setup correctly.
# --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.
# --no-bottle: Run brew install without --build-bottle. # --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. # --skip-relocation: Run brew bottle --skip-relocation to build new bottles for homebrew/portable.
# --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/. # --HEAD: Run brew install with --HEAD.
# --tap=<tap>: Use the git repository of the given tap. # --local: Ask Homebrew to write verbose logs under ./logs/ and set HOME to ./home/.
# --dry-run: Just print commands, don't run them. # --tap=<tap>: Use the git repository of the given tap.
# --fail-fast: Immediately exit on a failing step. # --dry-run: Just print commands, don't run them.
# --verbose: Print test step output in realtime. Has the side effect of passing output # --fail-fast: Immediately exit on a failing step.
# as raw bytes instead of re-encoding in UTF-8. # --verbose: Print test step output in realtime. Has the side effect of passing output
# --fast: Don't install any packages, but run e.g. audit anyway. # as raw bytes instead of re-encoding in UTF-8.
# --keep-tmp: Keep temporary files written by main installs and tests that are run. # --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.
# #
# --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.
@ -580,6 +581,7 @@ module Homebrew
if formula.stable? && !ARGV.include?("--fast") && !ARGV.include?("--no-bottle") && !formula.bottle_disabled? if formula.stable? && !ARGV.include?("--fast") && !ARGV.include?("--no-bottle") && !formula.bottle_disabled?
bottle_args = ["--verbose", "--json", formula_name] bottle_args = ["--verbose", "--json", formula_name]
bottle_args << "--keep-old" if ARGV.include? "--keep-old" bottle_args << "--keep-old" if ARGV.include? "--keep-old"
bottle_args << "--skip-relocation" if ARGV.include? "--skip-relocation"
test "brew", "bottle", *bottle_args test "brew", "bottle", *bottle_args
bottle_step = steps.last bottle_step = steps.last
if bottle_step.passed? && bottle_step.has_output? if bottle_step.passed? && bottle_step.has_output?