(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestTaskRunLogContext(t *testing.T) { |
| 24 | var buf bytes.Buffer |
| 25 | logger := slog.New(log.NewContextHandler(slog.NewTextHandler(&buf, nil))) |
| 26 | |
| 27 | ctx := taskRunLogContext(context.Background(), "project-a", 123) |
| 28 | logger.InfoContext(ctx, "task run started") |
| 29 | |
| 30 | output := buf.String() |
| 31 | require.Contains(t, output, `project=project-a`) |
| 32 | require.Contains(t, output, `task_run_id=123`) |
| 33 | } |
nothing calls this directly
no test coverage detected