Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit bb36ab9

Browse files
committed
tests: set PATH in cmd on windows
this allows windows to find the fake snyk executable used for tests Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
1 parent a7c3ed3 commit bb36ab9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

e2e/plugin_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ sleep 1000`), 0700))
6262

6363
// Add mock snyk binary to the $PATH
6464
path := os.Getenv("PATH")
65-
env.Patch(t, "PATH", fmt.Sprintf(pathFormat(), configDir+"/scan", path))()
65+
path = fmt.Sprintf(pathFormat(), configDir+"/scan", path)
66+
env.Patch(t, "PATH", path)()
67+
// force the env variable on command side on Windows
68+
if runtime.GOOS == "windows" {
69+
cmd.Env = append(cmd.Env, fmt.Sprintf("PATH=%s", path))
70+
}
6671

6772
cmd.Command = dockerCli.Command("scan", "--version")
73+
6874
icmd.StartCmd(cmd)
6975
time.Sleep(1 * time.Second)
7076

0 commit comments

Comments
 (0)