dev-cmd/tests: fix when euid != uid.

Otherwise you get:
`ruby: no -r allowed while running setuid (SecurityError)`
This commit is contained in:
Mike McQuaid 2024-04-11 17:26:38 +01:00
parent 707abc97f2
commit c4f2f06675
No known key found for this signature in database

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