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

Function TestResolveAppID_EnvVarOverridesYAML

cmd/compose/hooks_test.go:285–293  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

283}
284
285func TestResolveAppID_EnvVarOverridesYAML(t *testing.T) {
286 dir := t.TempDir()
287 mustWrite(t, dir, "compose.yaml", "name: from-yaml\nservices:\n svc:\n image: nginx\n")
288 t.Setenv("COMPOSE_PROJECT_NAME", "from-env")
289 unsetEnv(t, "COMPOSE_FILE")
290
291 got := resolveAppIDIn(t.Context(), nil, dir)
292 assert.Equal(t, got, "from-env")
293}
294
295func TestResolveAppID_NoComposeFileReturnsEmpty(t *testing.T) {
296 unsetEnv(t, "COMPOSE_PROJECT_NAME")

Callers

nothing calls this directly

Calls 4

mustWriteFunction · 0.85
unsetEnvFunction · 0.85
resolveAppIDInFunction · 0.85
TempDirMethod · 0.80

Tested by

no test coverage detected