MCPcopy Create free account
hub / github.com/go-task/task / TestOutputGroupErrorOnlyShowsOutputOnFailure

Function TestOutputGroupErrorOnlyShowsOutputOnFailure

task_test.go:2390–2406  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2388}
2389
2390func 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
2408func TestIncludedVars(t *testing.T) {
2409 t.Parallel()

Callers

nothing calls this directly

Calls 4

SetupMethod · 0.95
RunMethod · 0.95
ErrorMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…