@@ -23,6 +23,7 @@ import (
23
23
"os"
24
24
"path/filepath"
25
25
"regexp"
26
+ "runtime"
26
27
"strings"
27
28
"testing"
28
29
"time"
@@ -132,21 +133,31 @@ func TestLocalComposeUp(t *testing.T) {
132
133
})
133
134
}
134
135
136
+ func binExt () string {
137
+ binaryExt := ""
138
+ if runtime .GOOS == "windows" {
139
+ binaryExt = ".exe"
140
+ }
141
+ return binaryExt
142
+ }
135
143
func TestComposeUsingCliPlugin (t * testing.T ) {
136
144
c := NewParallelE2eCLI (t , binDir )
137
145
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 () ))
139
147
assert .NilError (t , err )
140
148
res := c .RunDockerOrExitError ("compose" , "ls" )
141
149
res .Assert (t , icmd.Expected {Err : "'compose' is not a docker command" , ExitCode : 1 })
142
150
}
143
151
144
152
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 )
146
157
147
- err : = os .Remove (filepath .Join (binDir , "docker" ))
158
+ err = os .Remove (filepath .Join (newBinFolder , "docker" + binExt () ))
148
159
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 () ))
150
161
assert .NilError (t , err )
151
162
res := c .RunDockerOrExitError ("compose" , "ls" )
152
163
res .Assert (t , icmd.Expected {Out : "NAME STATUS" , ExitCode : 0 })
0 commit comments