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

Function TestEnvInterpolation

pkg/e2e/compose_environment_test.go:192–206  ·  pkg/e2e/compose_environment_test.go::TestEnvInterpolation
(t *testing.T)

Source from the content-addressed store, hash-verified

190}
191
192func TestEnvInterpolation(t *testing.T) {
193 c := NewParallelCLI(t)
194
195 t.Run("shell priority from run command", func(t *testing.T) {
196 cmd := c.NewDockerComposeCmd(t, "-f", "./fixtures/environment/env-interpolation/compose.yaml", "config")
197 cmd.Env = append(cmd.Env, "WHEREAMI=shell")
198 res := icmd.RunCmd(cmd)
199 res.Assert(t, icmd.Expected{Out: `IMAGE: default_env:shell`})
200 })
201
202 t.Run("shell priority from run command using default value fallback", func(t *testing.T) {
203 c.RunDockerComposeCmd(t, "-f", "./fixtures/environment/env-interpolation-default-value/compose.yaml", "config").
204 Assert(t, icmd.Expected{Out: `IMAGE: default_env:EnvFileDefaultValue`})
205 })
206}
207
208func TestCommentsInEnvFile(t *testing.T) {
209 c := NewParallelCLI(t)

Callers

nothing calls this directly

Calls 4

NewParallelCLIFunction · 0.85
NewDockerComposeCmdMethod · 0.80
RunCmdMethod · 0.80
RunDockerComposeCmdMethod · 0.80

Tested by

no test coverage detected