Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit df7f57e

Browse files
committed
one more windows adaptation
Signed-off-by: guillaume.tardif <[email protected]>
1 parent 95179f1 commit df7f57e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

local/e2e/compose/compose_test.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os"
2424
"path/filepath"
2525
"regexp"
26+
"runtime"
2627
"strings"
2728
"testing"
2829
"time"
@@ -132,21 +133,31 @@ func TestLocalComposeUp(t *testing.T) {
132133
})
133134
}
134135

136+
func binExt() string {
137+
binaryExt := ""
138+
if runtime.GOOS == "windows" {
139+
binaryExt = ".exe"
140+
}
141+
return binaryExt
142+
}
135143
func TestComposeUsingCliPlugin(t *testing.T) {
136144
c := NewParallelE2eCLI(t, binDir)
137145

138-
err := os.Remove(filepath.Join(c.ConfigDir, "cli-plugins", "docker-compose"))
146+
err := os.Remove(filepath.Join(c.ConfigDir, "cli-plugins", "docker-compose"+binExt()))
139147
assert.NilError(t, err)
140148
res := c.RunDockerOrExitError("compose", "ls")
141149
res.Assert(t, icmd.Expected{Err: "'compose' is not a docker command", ExitCode: 1})
142150
}
143151

144152
func TestComposeCliPluginWithoutCloudIntegration(t *testing.T) {
145-
c := NewParallelE2eCLI(t, binDir)
153+
newBinFolder, cleanup, err := SetupExistingCLI() // do not share bin folder with other tests
154+
assert.NilError(t, err)
155+
defer cleanup()
156+
c := NewParallelE2eCLI(t, newBinFolder)
146157

147-
err := os.Remove(filepath.Join(binDir, "docker"))
158+
err = os.Remove(filepath.Join(newBinFolder, "docker"+binExt()))
148159
assert.NilError(t, err)
149-
err = os.Rename(filepath.Join(binDir, "com.docker.cli"), filepath.Join(binDir, "docker"))
160+
err = os.Rename(filepath.Join(newBinFolder, "com.docker.cli"+binExt()), filepath.Join(newBinFolder, "docker"+binExt()))
150161
assert.NilError(t, err)
151162
res := c.RunDockerOrExitError("compose", "ls")
152163
res.Assert(t, icmd.Expected{Out: "NAME STATUS", ExitCode: 0})

0 commit comments

Comments
 (0)