@@ -42,15 +42,17 @@ func TestComposeRunDdev(t *testing.T) {
42
42
// ddev shells out to `docker` and `docker-compose` (standalone), so a
43
43
// temporary directory is created with symlinks to system Docker and the
44
44
// locally-built standalone Compose binary to use as PATH
45
+ requiredTools := []string {
46
+ findToolInPath (t , DockerExecutableName ),
47
+ ComposeStandalonePath (t ),
48
+ findToolInPath (t , "tar" ),
49
+ findToolInPath (t , "gzip" ),
50
+ }
45
51
pathDir := t .TempDir ()
46
- dockerBin , err := exec .LookPath (DockerExecutableName )
47
- require .NoError (t , err , "Could not find %q in path" , DockerExecutableName )
48
- require .NoError (t , os .Symlink (dockerBin , filepath .Join (pathDir , DockerExecutableName )),
49
- "Could not create %q symlink" , DockerExecutableName )
50
-
51
- composeBin := ComposeStandalonePath (t )
52
- require .NoError (t , os .Symlink (composeBin , filepath .Join (pathDir , DockerComposeExecutableName )),
53
- "Could not create %q symlink" , DockerComposeExecutableName )
52
+ for _ , tool := range requiredTools {
53
+ require .NoError (t , os .Symlink (tool , filepath .Join (pathDir , filepath .Base (tool ))),
54
+ "Could not create symlink for %q" , tool )
55
+ }
54
56
55
57
c := NewCLI (t , WithEnv (
56
58
"DDEV_DEBUG=true" ,
@@ -97,3 +99,10 @@ func TestComposeRunDdev(t *testing.T) {
97
99
fmt .Println (out )
98
100
assert .Assert (t , strings .Contains (out , "ddev is working" ), "Could not start project" )
99
101
}
102
+
103
+ func findToolInPath (t testing.TB , name string ) string {
104
+ t .Helper ()
105
+ binPath , err := exec .LookPath (name )
106
+ require .NoError (t , err , "Could not find %q in path" , name )
107
+ return binPath
108
+ }
0 commit comments