diff --git a/lib/test_formulae.rb b/lib/test_formulae.rb index 7274c1d4..e37cc9d0 100644 --- a/lib/test_formulae.rb +++ b/lib/test_formulae.rb @@ -209,7 +209,15 @@ def artifact_cache_valid?(formula, formulae_dependents: false) return false if sha.blank? return false unless no_diff?(formula, sha) - formula.recursive_dependencies.all? do |dep| + recursive_dependencies = if formulae_dependents + formula.recursive_dependencies + else + formula.recursive_dependencies do |_, dep| + Dependency.prune if dep.build? || dep.test? + end + end + + recursive_dependencies.all? do |dep| no_diff?(dep.to_formula, sha) end end