Skip to content

Commit

Permalink
Merge pull request #446 from MikeMcQuaid/check-retry-tests
Browse files Browse the repository at this point in the history
formulae: adjust testing behaviour.
  • Loading branch information
MikeMcQuaid committed Jul 29, 2020
2 parents cedd41a + 5cf4ff8 commit 7c3ccb3
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions lib/tests/formulae.rb
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def install_dependent_from_source(dependent)
if @testable_dependents.include? dependent
test "brew", "install", "--only-dependencies", "--include-test",
dependent.full_name
test "brew", "test", "--verbose", dependent.full_name
test "brew", "test", "--retry", "--verbose", dependent.full_name
end

test "brew", "uninstall", "--force", dependent.full_name
Expand Down Expand Up @@ -533,7 +533,7 @@ def install_bottled_dependent(dependent)
if @testable_dependents.include? dependent
test "brew", "install", "--only-dependencies", "--include-test",
dependent.full_name
test "brew", "test", "--verbose", dependent.full_name
test "brew", "test", "--retry", "--verbose", dependent.full_name
end

test "brew", "uninstall", "--force", dependent.full_name
Expand Down Expand Up @@ -607,22 +607,30 @@ def formula!(formula_name)
bottle_reinstall_formula(formula, new_formula)
test "brew", "linkage", "--test", formula_name

if formula.test_defined?
test_passed_or_missing = if formula.test_defined?
test "brew", "install", "--only-dependencies", "--include-test",
formula_name
# Intentionally not passing --retry here to avoid papering over
# flaky tests when a formula isn't being pulled in as a dependent.
test "brew", "test", "--verbose", formula_name

steps.last.passed?
end

@source_dependents.each do |dependent|
install_dependent_from_source(dependent)
# Don't test dependents if the formula test failed.
if test_passed_or_missing
@source_dependents.each do |dependent|
install_dependent_from_source(dependent)

bottled = with_env(HOMEBREW_SKIP_OR_LATER_BOTTLES: "1") do
dependent.bottled?
bottled = with_env(HOMEBREW_SKIP_OR_LATER_BOTTLES: "1") do
dependent.bottled?
end
install_bottled_dependent(dependent) if bottled
end

@bottled_dependents.each do |dependent|
install_bottled_dependent(dependent)
end
install_bottled_dependent(dependent) if bottled
end
@bottled_dependents.each do |dependent|
install_bottled_dependent(dependent)
end
cleanup_bottle_etc_var(formula)
end
Expand Down

0 comments on commit 7c3ccb3

Please sign in to comment.