| 2388 | } |
| 2389 | |
| 2390 | func TestOutputGroupErrorOnlyShowsOutputOnFailure(t *testing.T) { |
| 2391 | t.Parallel() |
| 2392 | |
| 2393 | const dir = "testdata/output_group_error_only" |
| 2394 | var buff bytes.Buffer |
| 2395 | e := task.NewExecutor( |
| 2396 | task.WithDir(dir), |
| 2397 | task.WithStdout(&buff), |
| 2398 | task.WithStderr(&buff), |
| 2399 | ) |
| 2400 | require.NoError(t, e.Setup()) |
| 2401 | |
| 2402 | require.Error(t, e.Run(t.Context(), &task.Call{Task: "failing"})) |
| 2403 | t.Log(buff.String()) |
| 2404 | assert.Contains(t, "failing-output", strings.TrimSpace(buff.String())) |
| 2405 | assert.NotContains(t, "passing", strings.TrimSpace(buff.String())) |
| 2406 | } |
| 2407 | |
| 2408 | func TestIncludedVars(t *testing.T) { |
| 2409 | t.Parallel() |