mirror of https://github.com/docker/compose.git
e2e: add extra tools needed for ddev test
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
This commit is contained in:
parent
1c41df8f56
commit
3ae6c52e8a
|
@ -42,15 +42,17 @@ func TestComposeRunDdev(t *testing.T) {
|
||||||
// ddev shells out to `docker` and `docker-compose` (standalone), so a
|
// ddev shells out to `docker` and `docker-compose` (standalone), so a
|
||||||
// temporary directory is created with symlinks to system Docker and the
|
// temporary directory is created with symlinks to system Docker and the
|
||||||
// locally-built standalone Compose binary to use as PATH
|
// locally-built standalone Compose binary to use as PATH
|
||||||
|
requiredTools := []string{
|
||||||
|
findToolInPath(t, DockerExecutableName),
|
||||||
|
ComposeStandalonePath(t),
|
||||||
|
findToolInPath(t, "tar"),
|
||||||
|
findToolInPath(t, "gzip"),
|
||||||
|
}
|
||||||
pathDir := t.TempDir()
|
pathDir := t.TempDir()
|
||||||
dockerBin, err := exec.LookPath(DockerExecutableName)
|
for _, tool := range requiredTools {
|
||||||
require.NoError(t, err, "Could not find %q in path", DockerExecutableName)
|
require.NoError(t, os.Symlink(tool, filepath.Join(pathDir, filepath.Base(tool))),
|
||||||
require.NoError(t, os.Symlink(dockerBin, filepath.Join(pathDir, DockerExecutableName)),
|
"Could not create symlink for %q", tool)
|
||||||
"Could not create %q symlink", DockerExecutableName)
|
}
|
||||||
|
|
||||||
composeBin := ComposeStandalonePath(t)
|
|
||||||
require.NoError(t, os.Symlink(composeBin, filepath.Join(pathDir, DockerComposeExecutableName)),
|
|
||||||
"Could not create %q symlink", DockerComposeExecutableName)
|
|
||||||
|
|
||||||
c := NewCLI(t, WithEnv(
|
c := NewCLI(t, WithEnv(
|
||||||
"DDEV_DEBUG=true",
|
"DDEV_DEBUG=true",
|
||||||
|
@ -97,3 +99,10 @@ func TestComposeRunDdev(t *testing.T) {
|
||||||
fmt.Println(out)
|
fmt.Println(out)
|
||||||
assert.Assert(t, strings.Contains(out, "ddev is working"), "Could not start project")
|
assert.Assert(t, strings.Contains(out, "ddev is working"), "Could not start project")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func findToolInPath(t testing.TB, name string) string {
|
||||||
|
t.Helper()
|
||||||
|
binPath, err := exec.LookPath(name)
|
||||||
|
require.NoError(t, err, "Could not find %q in path", name)
|
||||||
|
return binPath
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue