Merge pull request #17073 from Homebrew/fix_brew_tests_euid

dev-cmd/tests: fix when euid != uid.
This commit is contained in:
Mike McQuaid 2024-04-11 17:41:14 +01:00 committed by GitHub
commit 7e887bb325
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,6 +144,10 @@ module Homebrew
ohai "Running tests with BuildPulse-friendly settings"
end
# Workaround for:
# ruby: no -r allowed while running setuid (SecurityError)
Process::UID.change_privilege(Process.euid) if Process.euid != Process.uid
if parallel
system "bundle", "exec", "parallel_rspec", *parallel_args, "--", *bundle_args, "--", *files
else