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.
This commit is contained in:
Mike McQuaid 2018-09-02 12:56:31 +01:00
parent 794fe5d21d
commit c46cecf277
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -49,6 +49,10 @@ module Homebrew
ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic? ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic?
ENV["HOMEBREW_TEST_ONLINE"] = "1" if args.online? 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? if args.coverage?
ENV["HOMEBREW_TESTS_COVERAGE"] = "1" ENV["HOMEBREW_TESTS_COVERAGE"] = "1"
FileUtils.rm_f "test/coverage/.resultset.json" FileUtils.rm_f "test/coverage/.resultset.json"