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

Function TestProjectWithDiscardEnvFile

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

Source from the content-addressed store, hash-verified

292}
293
294func TestProjectWithDiscardEnvFile(t *testing.T) {
295 opts, err := NewProjectOptions([]string{
296 "testdata/env-file/compose-with-env-file.yaml",
297 }, WithDiscardEnvFile)
298
299 assert.NilError(t, err)
300 p, err := ProjectFromOptions(context.TODO(), opts)
301 assert.NilError(t, err)
302 service, err := p.GetService("simple")
303 assert.NilError(t, err)
304 assert.Equal(t, *service.Environment["DEFAULT_PORT"], "8080")
305 assert.Assert(t, len(service.EnvFiles) == 0)
306 assert.Equal(t, service.Ports[0].Published, "8000")
307}
308
309func TestProjectWithMultipleEnvFile(t *testing.T) {
310 opts, err := NewProjectOptions([]string{

Callers

nothing calls this directly

Calls 3

NewProjectOptionsFunction · 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…