test: check for pgrep/pkill for developers/CI.

If people are running `brew test` but don't have `pgrep` or `pkill`
installed the forked processes may never be killed. This is not a big
deal on a user's machine but on CI may make a job block and never
complete/timeout successfully.
This commit is contained in:
Mike McQuaid 2020-09-17 13:05:01 +01:00
parent 164f0f0ee0
commit 541fecea22
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -24,6 +24,11 @@ begin
trap("INT", old_trap)
if Homebrew::EnvConfig.developer? || ENV["CI"].present?
raise "cannot find child processes without `pgrep`, please install!" unless which("pgrep")
raise "cannot kill child processes without `pkill`, please install!" unless which("pkill")
end
formula = args.named.to_resolved_formulae.first
formula.extend(Homebrew::Assertions)
formula.extend(Homebrew::FreePort)