run icon indicating copy to clipboard operation
run copied to clipboard

testing story (e.g. mock shell environments)

Open bobheadxi opened this issue 3 years ago • 0 comments

Some ideas:

  1. encourage scripts to accept Output instances, provide outputtest package for building simple mocks
  2. provide a "command factory" analogous to Buildkite's Shell, e.g. shell.Cmd() - this factory could be an interface that facilitates mocking. Alternatively, it could be shell.Run(Runner), where *Command implements Runner (now that I think of it, I like the latter):
    out := shell.Run(run.Cmd(ctx, "foobar")) // shell can mock execution and output, or propagate shared env
    

cc @jhchabran

bobheadxi avatar May 09 '22 18:05 bobheadxi