test-bot: only test --no-compat for Homebrew/brew. (#286)
This job takes almost a minute and it's not useful for all core taps to run this.
This commit is contained in:
parent
f946693b56
commit
2f1be1f36f
@ -87,8 +87,6 @@ module Homebrew
|
|||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
CoreTap.instance
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class Step
|
class Step
|
||||||
@ -219,8 +217,8 @@ module Homebrew
|
|||||||
@added_formulae = []
|
@added_formulae = []
|
||||||
@modified_formula = []
|
@modified_formula = []
|
||||||
@steps = []
|
@steps = []
|
||||||
@tap = options.fetch(:tap, CoreTap.instance)
|
@tap = options[:tap]
|
||||||
@repository = @tap.path
|
@repository = @tap ? @tap.path : HOMEBREW_REPOSITORY
|
||||||
@skip_homebrew = options.fetch(:skip_homebrew, false)
|
@skip_homebrew = options.fetch(:skip_homebrew, false)
|
||||||
|
|
||||||
if quiet_system "git", "-C", @repository.to_s, "rev-parse", "--verify", "-q", argument
|
if quiet_system "git", "-C", @repository.to_s, "rev-parse", "--verify", "-q", argument
|
||||||
@ -273,6 +271,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def diff_formulae(start_revision, end_revision, path, filter)
|
def diff_formulae(start_revision, end_revision, path, filter)
|
||||||
|
return unless @tap
|
||||||
git(
|
git(
|
||||||
"diff-tree", "-r", "--name-only", "--diff-filter=#{filter}",
|
"diff-tree", "-r", "--name-only", "--diff-filter=#{filter}",
|
||||||
start_revision, end_revision, "--", path
|
start_revision, end_revision, "--", path
|
||||||
@ -360,6 +359,7 @@ module Homebrew
|
|||||||
|
|
||||||
return unless diff_start_sha1 != diff_end_sha1
|
return unless diff_start_sha1 != diff_end_sha1
|
||||||
return if @url && steps.last && !steps.last.passed?
|
return if @url && steps.last && !steps.last.passed?
|
||||||
|
return unless @tap
|
||||||
|
|
||||||
formula_path = @tap.formula_dir.to_s
|
formula_path = @tap.formula_dir.to_s
|
||||||
@added_formulae += diff_formulae(diff_start_sha1, diff_end_sha1, formula_path, "A")
|
@added_formulae += diff_formulae(diff_start_sha1, diff_end_sha1, formula_path, "A")
|
||||||
@ -631,16 +631,18 @@ module Homebrew
|
|||||||
def homebrew
|
def homebrew
|
||||||
@category = __method__
|
@category = __method__
|
||||||
return if @skip_homebrew
|
return if @skip_homebrew
|
||||||
test "brew", "tests"
|
|
||||||
if @tap.core_tap?
|
ruby_two = RUBY_VERSION.split(".").first.to_i >= 2
|
||||||
tests_args = ["--no-compat"]
|
tests_args = []
|
||||||
readall_args = ["--aliases"]
|
tests_args << "--coverage" if ruby_two && ENV["TRAVIS"]
|
||||||
if RUBY_VERSION.split(".").first.to_i >= 2
|
|
||||||
tests_args << "--coverage" if ENV["TRAVIS"]
|
|
||||||
readall_args << "--syntax"
|
|
||||||
end
|
|
||||||
test "brew", "tests", *tests_args
|
test "brew", "tests", *tests_args
|
||||||
test "brew", "readall", *readall_args
|
|
||||||
|
if @tap.nil?
|
||||||
|
test "brew", "tests", "--no-compat"
|
||||||
|
elsif @tap.core_tap?
|
||||||
|
readall_args = []
|
||||||
|
readall_args << "--syntax" if ruby_two
|
||||||
|
test "brew", "readall", "--aliases", *readall_args
|
||||||
else
|
else
|
||||||
test "brew", "readall", @tap.name
|
test "brew", "readall", @tap.name
|
||||||
end
|
end
|
||||||
@ -762,6 +764,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_ci_upload(tap)
|
def test_ci_upload(tap)
|
||||||
|
raise "Need a tap to upload!" unless tap
|
||||||
|
|
||||||
# Don't trust formulae we're uploading
|
# Don't trust formulae we're uploading
|
||||||
ENV["HOMEBREW_DISABLE_LOAD_FORMULA"] = "1"
|
ENV["HOMEBREW_DISABLE_LOAD_FORMULA"] = "1"
|
||||||
|
|
||||||
@ -906,7 +910,7 @@ module Homebrew
|
|||||||
# because Formula parsing and/or git commit hash lookup depends on it.
|
# because Formula parsing and/or git commit hash lookup depends on it.
|
||||||
# At the same time, make sure Tap is not a shallow clone.
|
# At the same time, make sure Tap is not a shallow clone.
|
||||||
# bottle revision and bottle upload rely on full clone.
|
# bottle revision and bottle upload rely on full clone.
|
||||||
safe_system "brew", "tap", tap.name, "--full"
|
safe_system "brew", "tap", tap.name, "--full" if tap
|
||||||
|
|
||||||
if ARGV.include? "--ci-upload"
|
if ARGV.include? "--ci-upload"
|
||||||
return test_ci_upload(tap)
|
return test_ci_upload(tap)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user