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

Function TestImageVolume

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

Source from the content-addressed store, hash-verified

173}
174
175func TestImageVolume(t *testing.T) {
176 c := NewCLI(t)
177 const projectName = "compose-e2e-image-volume"
178 t.Cleanup(func() {
179 c.cleanupWithDown(t, projectName)
180 })
181
182 version := c.RunDockerCmd(t, "version", "-f", "{{.Server.Version}}")
183 major, _, found := strings.Cut(version.Combined(), ".")
184 assert.Assert(t, found)
185 if major == "26" || major == "27" {
186 t.Skip("Skipping test due to docker version < 28")
187 }
188
189 res := c.RunDockerComposeCmd(t, "-f", "./fixtures/volumes/compose.yaml", "--project-name", projectName, "up", "with_image")
190 out := res.Combined()
191 assert.Check(t, strings.Contains(out, "index.html"))
192}
193
194func TestImageVolumeRecreateOnRebuild(t *testing.T) {
195 c := NewCLI(t)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…