Merge pull request #5776 from sjackman/tests-user

tests: Set environment variable USER if not set
This commit is contained in:
Mike McQuaid 2019-02-21 13:26:44 +00:00 committed by GitHub
commit e1c12de1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,8 @@ module Homebrew
ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic?
ENV["HOMEBREW_TEST_ONLINE"] = "1" if args.online?
ENV["USER"] ||= system_command!("id", args: ["-nu"]).stdout.chomp
# Avoid local configuration messing with tests e.g. git being configured
# to use GPG to sign by default
ENV["HOME"] = "#{HOMEBREW_LIBRARY_PATH}/test"