(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestProjectVolumeBind(t *testing.T) { |
| 96 | if composeStandaloneMode { |
| 97 | t.Skip() |
| 98 | } |
| 99 | c := NewParallelCLI(t) |
| 100 | const projectName = "compose-e2e-project-volume-bind" |
| 101 | |
| 102 | t.Run("up on project volume with bind specification", func(t *testing.T) { |
| 103 | if runtime.GOOS == "windows" { |
| 104 | t.Skip("Running on Windows. Skipping...") |
| 105 | } |
| 106 | tmpDir := t.TempDir() |
| 107 | |
| 108 | c.RunDockerComposeCmd(t, "--project-name", projectName, "down") |
| 109 | |
| 110 | c.RunDockerOrExitError(t, "volume", "rm", "-f", projectName+"_project-data").Assert(t, icmd.Success) |
| 111 | cmd := c.NewCmdWithEnv([]string{"TEST_DIR=" + tmpDir}, |
| 112 | "docker", "compose", "--project-directory", "fixtures/project-volume-bind-test", "--project-name", projectName, "up", "-d") |
| 113 | icmd.RunCmd(cmd).Assert(t, icmd.Success) |
| 114 | defer c.RunDockerComposeCmd(t, "--project-name", projectName, "down") |
| 115 | |
| 116 | c.RunCmd(t, "sh", "-c", "echo SUCCESS > "+filepath.Join(tmpDir, "resultfile")).Assert(t, icmd.Success) |
| 117 | |
| 118 | ret := c.RunDockerOrExitError(t, "exec", "frontend", "bash", "-c", "cat /data/resultfile").Assert(t, icmd.Success) |
| 119 | assert.Assert(t, strings.Contains(ret.Stdout(), "SUCCESS")) |
| 120 | }) |
| 121 | } |
| 122 | |
| 123 | func TestUpSwitchVolumes(t *testing.T) { |
| 124 | c := NewCLI(t) |
nothing calls this directly
no test coverage detected