MCPcopy Create free account
hub / github.com/compose-spec/compose-go / TestProjectWithMultipleEnvFile

Function TestProjectWithMultipleEnvFile

cli/options_test.go:309–324  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

307}
308
309func TestProjectWithMultipleEnvFile(t *testing.T) {
310 opts, err := NewProjectOptions([]string{
311 "testdata/env-file/compose-with-env-files.yaml",
312 }, WithDiscardEnvFile,
313 WithEnvFiles("testdata/env-file/.env", "testdata/env-file/override.env"),
314 WithDotEnv)
315
316 assert.NilError(t, err)
317 p, err := ProjectFromOptions(context.TODO(), opts)
318 assert.NilError(t, err)
319 service, err := p.GetService("simple")
320 assert.NilError(t, err)
321 assert.Equal(t, *service.Environment["DEFAULT_PORT"], "9090")
322 assert.Assert(t, len(service.EnvFiles) == 0)
323 assert.Equal(t, service.Ports[0].Published, "9000")
324}
325
326func TestProjectNameFromWorkingDir(t *testing.T) {
327 opts, err := NewProjectOptions([]string{

Callers

nothing calls this directly

Calls 4

NewProjectOptionsFunction · 0.85
WithEnvFilesFunction · 0.85
ProjectFromOptionsFunction · 0.85
GetServiceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…