minimal testing when there is no PATH

Also cherry picked 50808af9423a940c61144b24bd3bf81c54669c58 from master which help with slow build machines