test-bot: test bottled dependents.

Test everything that `brew uses` a formula, has a bottle and a test.

This should allow some quick gains in terms of spotting formulae that may need
revisioned to avoid problems with shifting dependencies. As the test-bot lives
in a data centre with (very) fast internet the fetch and extraction time
shouldn't slow things down much.

Closes Homebrew/homebrew#35092.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Mike McQuaid 2014-12-18 17:03:17 +00:00
parent 73ff739583
commit f475f750f9

View File

@ -352,6 +352,14 @@ module Homebrew
dependencies -= `brew list`.split("\n") dependencies -= `brew list`.split("\n")
unchanged_dependencies = dependencies - @formulae unchanged_dependencies = dependencies - @formulae
changed_dependences = dependencies - unchanged_dependencies changed_dependences = dependencies - unchanged_dependencies
dependents = `brew uses #{formula_name}`.split("\n")
testable_dependents = dependents.map {|d| Formulary.factory(d)}
testable_dependents.select! {|d| d.test_defined? && d.stable.bottled? }
uninstalled_testable_dependents = testable_dependents.reject {|d| d.installed? }
testable_dependents.map! &:name
uninstalled_testable_dependents.map! &:name
formula = Formulary.factory(formula_name) formula = Formulary.factory(formula_name)
return unless satisfied_requirements?(formula, :stable) return unless satisfied_requirements?(formula, :stable)
@ -421,6 +429,11 @@ module Homebrew
end end
end end
test "brew", "test", "--verbose", formula_name if formula.test_defined? test "brew", "test", "--verbose", formula_name if formula.test_defined?
if testable_dependents.any?
test "brew", "fetch", *uninstalled_testable_dependents
test "brew", "install", *uninstalled_testable_dependents
test "brew", "test", *testable_dependents
end
test "brew", "uninstall", "--force", formula_name test "brew", "uninstall", "--force", formula_name
end end