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

Method NewCmdWithEnv

pkg/e2e/framework.go:297–305  ·  view source on GitHub ↗

NewCmdWithEnv creates a cmd object configured with the test environment set with additional env vars

(envvars []string, command string, args ...string)

Source from the content-addressed store, hash-verified

295
296// NewCmdWithEnv creates a cmd object configured with the test environment set with additional env vars
297func (c *CLI) NewCmdWithEnv(envvars []string, command string, args ...string) icmd.Cmd {
298 // base env -> CLI overrides -> cmd overrides
299 cmdEnv := append(c.BaseEnvironment(), c.env...)
300 cmdEnv = append(cmdEnv, envvars...)
301 return icmd.Cmd{
302 Command: append([]string{command}, args...),
303 Env: cmdEnv,
304 }
305}
306
307// MetricsSocket get the path where test metrics will be sent
308func (c *CLI) MetricsSocket() string {

Callers 2

TestNetworkConfigChangedFunction · 0.95
TestProjectVolumeBindFunction · 0.80

Calls 1

BaseEnvironmentMethod · 0.95

Tested by 2

TestNetworkConfigChangedFunction · 0.76
TestProjectVolumeBindFunction · 0.64