MCPcopy
hub / github.com/docker/compose / TestUpRecreateVolumes

Function TestUpRecreateVolumes

pkg/e2e/volumes_test.go:145–160  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

143}
144
145func TestUpRecreateVolumes(t *testing.T) {
146 c := NewCLI(t)
147 const projectName = "compose-e2e-recreate-volumes"
148 t.Cleanup(func() {
149 c.cleanupWithDown(t, projectName)
150 })
151
152 c.RunDockerComposeCmd(t, "-f", "./fixtures/recreate-volumes/compose.yaml", "--project-name", projectName, "up", "-d")
153
154 res := c.RunDockerCmd(t, "volume", "inspect", fmt.Sprintf("%s_my_vol", projectName), "-f", "{{ index .Labels \"foo\" }}")
155 res.Assert(t, icmd.Expected{Out: "bar"})
156
157 c.RunDockerComposeCmd(t, "-f", "./fixtures/recreate-volumes/compose2.yaml", "--project-name", projectName, "up", "-d", "-y")
158 res = c.RunDockerCmd(t, "volume", "inspect", fmt.Sprintf("%s_my_vol", projectName), "-f", "{{ index .Labels \"foo\" }}")
159 res.Assert(t, icmd.Expected{Out: "zot"})
160}
161
162func TestUpRecreateVolumes_IgnoreBinds(t *testing.T) {
163 c := NewCLI(t)

Callers

nothing calls this directly

Calls 4

cleanupWithDownMethod · 0.95
RunDockerComposeCmdMethod · 0.95
RunDockerCmdMethod · 0.95
NewCLIFunction · 0.85

Tested by

no test coverage detected