Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formulae: adjust testing behaviour. #446

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering it is called test_passed_or_missing, don't we want:

Suggested change
steps.last.passed?
steps.last.passed?
else
true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was there in a previous iteration, I swear 😅.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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