MCPcopy Create free account
hub / github.com/docker/compose / TestRemoveOrphaned

Function TestRemoveOrphaned

pkg/e2e/compose_test.go:296–315  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

294}
295
296func TestRemoveOrphaned(t *testing.T) {
297 const projectName = "compose-e2e-remove-orphaned"
298 c := NewParallelCLI(t)
299
300 cleanup := func() {
301 c.RunDockerComposeCmd(t, "-p", projectName, "down", "--remove-orphans", "--timeout=0")
302 }
303 cleanup()
304 t.Cleanup(cleanup)
305
306 // run stack
307 c.RunDockerComposeCmd(t, "-f", "./fixtures/sentences/compose.yaml", "-p", projectName, "up", "-d")
308
309 // down "web" service with orphaned removed
310 c.RunDockerComposeCmd(t, "-f", "./fixtures/sentences/compose.yaml", "-p", projectName, "down", "--remove-orphans", "web")
311
312 // check "words" service has not been considered orphaned
313 res := c.RunDockerComposeCmd(t, "-f", "./fixtures/sentences/compose.yaml", "-p", projectName, "ps", "--format", "{{.Name}}")
314 res.Assert(t, icmd.Expected{Out: fmt.Sprintf("%s-words-1", projectName)})
315}
316
317func TestComposeFileSetByDotEnv(t *testing.T) {
318 c := NewCLI(t)

Callers

nothing calls this directly

Calls 2

NewParallelCLIFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected