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

Method RunCmdInDir

pkg/e2e/framework.go:341–350  ·  view source on GitHub ↗

RunCmdInDir runs a command in a given dir, expects no error and returns a result

(t testing.TB, dir string, args ...string)

Source from the content-addressed store, hash-verified

339
340// RunCmdInDir runs a command in a given dir, expects no error and returns a result
341func (c *CLI) RunCmdInDir(t testing.TB, dir string, args ...string) *icmd.Result {
342 t.Helper()
343 t.Logf("\t[%s] %s\n", t.Name(), strings.Join(args, " "))
344 assert.Assert(t, len(args) >= 1, "require at least one command in parameters")
345 cmd := c.NewCmd(args[0], args[1:]...)
346 cmd.Dir = dir
347 res := icmd.RunCmd(cmd)
348 res.Assert(t, icmd.Success)
349 return res
350}
351
352// RunDockerCmd runs a docker command, expects no error and returns a result
353func (c *CLI) RunDockerCmd(t testing.TB, args ...string) *icmd.Result {

Callers

nothing calls this directly

Calls 3

NewCmdMethod · 0.95
RunCmdMethod · 0.80
NameMethod · 0.45

Tested by

no test coverage detected