1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

Adding a --concurrency (-C) flag

This commit is contained in:
Ross Hammermeister
2020-06-12 12:09:53 -06:00
committed by Andrey Nering
parent f0cd7d27fb
commit c6ecf70377
6 changed files with 119 additions and 22 deletions

View File

@ -171,6 +171,22 @@ func TestVarsInvalidTmpl(t *testing.T) {
assert.EqualError(t, e.Run(context.Background(), taskfile.Call{Task: target}), expectError, "e.Run(target)")
}
func TestConcurrency(t *testing.T) {
const (
dir = "testdata/concurrency"
target = "default"
)
e := &task.Executor{
Dir: dir,
Stdout: ioutil.Discard,
Stderr: ioutil.Discard,
Concurrency: 1,
}
assert.NoError(t, e.Setup(), "e.Setup()")
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: target}), "e.Run(target)")
}
func TestParams(t *testing.T) {
tt := fileContentTest{
Dir: "testdata/params",