Both tests check that the agent is not detected before its folder exists.
Detected also looks for the agent's command on PATH, so an omo or jcode
installed on the host made the tests fail. Both tests now run with an
empty temp dir as PATH. The TestOmo line is the reporter's.
To find every test with this problem, the whole agent package was run
with a fake executable on PATH for each agent id and Bin (145 names):
- TestOmo and TestJcodeHome failed.
- TestInstallWithoutNodeStopsWhenTheDownloadFails also failed, but only
because the fake curl stood in for the real one. That is not an agent
detection.
With this change, both tests pass with the fakes on PATH. go test -tags
nogui ./internal/agent/ is green, and gofmt -l and go vet are clean on
darwin, linux and windows.