From c46cecf277c497027f7777ee01e26a034e84ac3e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 2 Sep 2018 12:56:31 +0100 Subject: [PATCH] tests: set HOME. This is the only way to override the user's Git configuration which can break tests when e.g. `gpg` cannot be found but signing is requested. --- Library/Homebrew/dev-cmd/tests.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index bf721db0c6..f26bfed4ab 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -49,6 +49,10 @@ module Homebrew ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic? ENV["HOMEBREW_TEST_ONLINE"] = "1" if args.online? + # Avoid local configuration messing with tests e.g. git being configured + # to use GPG to sign by default + ENV["HOME"] = "#{HOMEBREW_LIBRARY_PATH}/test" + if args.coverage? ENV["HOMEBREW_TESTS_COVERAGE"] = "1" FileUtils.rm_f "test/coverage/.resultset.json"