aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Afanasjew2016-01-04 14:54:09 +0100
committerMartin Afanasjew2016-01-04 16:26:36 +0100
commitbd4f633673e12793d8ec18a45c352a2d4d1fc382 (patch)
tree03a34862d2761de950573a56ffc57836c160516b /Library
parent301d88544f1b1336eb32817bfc0efc05fc5023ac (diff)
downloadbrew-bd4f633673e12793d8ec18a45c352a2d4d1fc382.tar.bz2
tests: use predefined commit author for robustness
Some tests, that construct a Git repository for testing, will silently fail if the global Git user isn't properly set up. There are valid use cases for this, thus use a fixed commit author/committer for all tests instead of relying on the user's configuration.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/tests.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/tests.rb b/Library/Homebrew/cmd/tests.rb
index 38f087533..c5af2a72f 100644
--- a/Library/Homebrew/cmd/tests.rb
+++ b/Library/Homebrew/cmd/tests.rb
@@ -5,6 +5,13 @@ module Homebrew
ENV["HOMEBREW_TESTS_COVERAGE"] = "1" if ARGV.include? "--coverage"
ENV["HOMEBREW_NO_COMPAT"] = "1" if ARGV.include? "--no-compat"
+ # Override author/committer as global settings might be invalid and thus
+ # will cause silent failure during the setup of dummy Git repositories.
+ %w[AUTHOR COMMITTER].each do |role|
+ ENV["GIT_#{role}_NAME"] = "brew tests"
+ ENV["GIT_#{role}_EMAIL"] = "brew-tests@localhost"
+ end
+
Homebrew.install_gem_setup_path! "bundler"
unless quiet_system("bundle", "check")
system "bundle", "install", "--path", "vendor/bundle"