test-bot: skip some unnecessary tests.

This commit is contained in:
Mike McQuaid 2015-09-11 15:29:16 +01:00
parent 3e12ffa6a7
commit 96be0c2724

View File

@ -175,15 +175,16 @@ module Homebrew
class Test class Test
attr_reader :log_root, :category, :name, :steps attr_reader :log_root, :category, :name, :steps
def initialize(argument, tap = nil) def initialize(argument, options={})
@hash = nil @hash = nil
@url = nil @url = nil
@formulae = [] @formulae = []
@added_formulae = [] @added_formulae = []
@modified_formula = [] @modified_formula = []
@steps = [] @steps = []
@tap = tap @tap = options[:tap]
@repository = Homebrew.homebrew_git_repo @tap @repository = Homebrew.homebrew_git_repo @tap
@skip_homebrew = ARGV.include?("--skip-homebrew") || options[:skip_homebrew]
url_match = argument.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX url_match = argument.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX
@ -571,9 +572,9 @@ module Homebrew
def homebrew def homebrew
@category = __method__ @category = __method__
return if ARGV.include? "--skip-homebrew" return if @skip_homebrew
test "brew", "tests" test "brew", "tests"
test "brew", "tests", "--no-compat" test "brew", "tests", "--no-compat" if @tap
readall_args = ["--aliases"] readall_args = ["--aliases"]
readall_args << "--syntax" if MacOS.version >= :mavericks readall_args << "--syntax" if MacOS.version >= :mavericks
test "brew", "readall", *readall_args test "brew", "readall", *readall_args
@ -861,14 +862,16 @@ module Homebrew
any_errors = false any_errors = false
if ARGV.named.empty? if ARGV.named.empty?
# With no arguments just build the most recent commit. # With no arguments just build the most recent commit.
head_test = Test.new("HEAD", tap) head_test = Test.new("HEAD", :tap => tap)
any_errors = !head_test.run any_errors = !head_test.run
tests << head_test tests << head_test
else else
skip_homebrew = false
ARGV.named.each do |argument| ARGV.named.each do |argument|
test_error = false test_error = false
begin begin
test = Test.new(argument, tap) test = Test.new(argument, :tap => tap, :skip_homebrew = skip_homebrew)
skip_homebrew ||= true
rescue ArgumentError => e rescue ArgumentError => e
test_error = true test_error = true
ofail e.message ofail e.message