1717package e2e
1818
1919import (
20- "errors"
2120 "fmt"
2221 "io"
2322 "io/ioutil"
@@ -31,6 +30,7 @@ import (
3130 "testing"
3231 "time"
3332
33+ "github.com/pkg/errors"
3434 "gotest.tools/v3/assert"
3535 is "gotest.tools/v3/assert/cmp"
3636 "gotest.tools/v3/icmd"
@@ -90,10 +90,15 @@ func newE2eCLI(t *testing.T, binDir string) *E2eCLI {
9090 if runtime .GOOS == "windows" {
9191 composePluginFile += ".exe"
9292 }
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+ }
97102 }
98103
99104 return & E2eCLI {binDir , d , t }
@@ -158,7 +163,7 @@ func findExecutable(executableName string, paths []string) (string, error) {
158163 return bin , nil
159164 }
160165
161- return "" , errors .New ( "executable not found" )
166+ return "" , errors .Wrap ( os . ErrNotExist , "executable not found" )
162167}
163168
164169// CopyFile copies a file from a sourceFile to a destinationFile setting permissions to 0755
0 commit comments