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

Function TestUnsetEnv

pkg/e2e/compose_environment_test.go:226–245  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

224}
225
226func TestUnsetEnv(t *testing.T) {
227 c := NewParallelCLI(t)
228 t.Cleanup(func() {
229 c.RunDockerComposeCmd(t, "--project-name", "empty-variable", "down", "--rmi", "all")
230 })
231
232 t.Run("override env variable", func(t *testing.T) {
233 c.RunDockerComposeCmd(t, "-f", "./fixtures/environment/empty-variable/compose.yaml", "build")
234
235 res := c.RunDockerComposeCmd(t, "-f", "./fixtures/environment/empty-variable/compose.yaml",
236 "run", "-e", "EMPTY=hello", "--rm", "empty-variable")
237 res.Assert(t, icmd.Expected{Out: `=hello=`})
238 })
239
240 t.Run("unset env variable", func(t *testing.T) {
241 res := c.RunDockerComposeCmd(t, "-f", "./fixtures/environment/empty-variable/compose.yaml",
242 "run", "--rm", "empty-variable")
243 res.Assert(t, icmd.Expected{Out: `==`})
244 })
245}

Callers

nothing calls this directly

Calls 2

NewParallelCLIFunction · 0.85
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…