17
17
package e2e
18
18
19
19
import (
20
- "errors"
21
20
"fmt"
22
21
"io"
23
22
"io/ioutil"
@@ -31,6 +30,7 @@ import (
31
30
"testing"
32
31
"time"
33
32
33
+ "github.com/pkg/errors"
34
34
"gotest.tools/v3/assert"
35
35
is "gotest.tools/v3/assert/cmp"
36
36
"gotest.tools/v3/icmd"
@@ -90,10 +90,15 @@ func newE2eCLI(t *testing.T, binDir string) *E2eCLI {
90
90
if runtime .GOOS == "windows" {
91
91
composePluginFile += ".exe"
92
92
}
93
- composePlugin , _ := findExecutable (composePluginFile , []string {"../../bin" , "../../../bin" })
94
- err = CopyFile (composePlugin , filepath .Join (d , "cli-plugins" , composePluginFile ))
95
- if err != nil {
96
- panic (err )
93
+ composePlugin , err := findExecutable (composePluginFile , []string {"../../bin" , "../../../bin" })
94
+ if os .IsNotExist (err ) {
95
+ fmt .Println ("WARNING: docker-compose cli-plugin not found" )
96
+ }
97
+ if err == nil {
98
+ err = CopyFile (composePlugin , filepath .Join (d , "cli-plugins" , composePluginFile ))
99
+ if err != nil {
100
+ panic (err )
101
+ }
97
102
}
98
103
99
104
return & E2eCLI {binDir , d , t }
@@ -158,7 +163,7 @@ func findExecutable(executableName string, paths []string) (string, error) {
158
163
return bin , nil
159
164
}
160
165
161
- return "" , errors .New ( "executable not found" )
166
+ return "" , errors .Wrap ( os . ErrNotExist , "executable not found" )
162
167
}
163
168
164
169
// CopyFile copies a file from a sourceFile to a destinationFile setting permissions to 0755
0 commit comments