| 2156 | } |
| 2157 | |
| 2158 | func TestExitImmediately(t *testing.T) { |
| 2159 | t.Parallel() |
| 2160 | |
| 2161 | const dir = "testdata/exit_immediately" |
| 2162 | |
| 2163 | var buff bytes.Buffer |
| 2164 | e := task.NewExecutor( |
| 2165 | task.WithDir(dir), |
| 2166 | task.WithStdout(&buff), |
| 2167 | task.WithStderr(&buff), |
| 2168 | task.WithSilent(true), |
| 2169 | ) |
| 2170 | require.NoError(t, e.Setup()) |
| 2171 | |
| 2172 | require.Error(t, e.Run(t.Context(), &task.Call{Task: "default"})) |
| 2173 | assert.Contains(t, buff.String(), `"this_should_fail": executable file not found in $PATH`) |
| 2174 | } |
| 2175 | |
| 2176 | func TestRunOnlyRunsJobsHashOnce(t *testing.T) { |
| 2177 | t.Parallel() |