MCPcopy
hub / github.com/grafana/tempo / TestValidateAccumulatesErrors

Function TestValidateAccumulatesErrors

tools/chloggen/cmd/validate_test.go:182–207  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func TestValidateAccumulatesErrors(t *testing.T) {
183 entries := []*chlog.Entry{
184 {
185 ChangeType: "fake_type",
186 Component: "component",
187 Note: "note",
188 Issues: []int{123},
189 },
190 {
191 ChangeType: "bug_fix",
192 Component: "",
193 Note: "note",
194 Issues: []int{456},
195 },
196 }
197
198 cfg := config.New(t.TempDir())
199 globalCfg = cfg
200 setupTestDir(t, entries)
201
202 _, err := runCobra(t, "validate")
203
204 assert.Error(t, err)
205 assert.ErrorContains(t, err, "'fake_type' is not a valid 'change_type'")
206 assert.ErrorContains(t, err, "specify a 'component'")
207}

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
setupTestDirFunction · 0.85
runCobraFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected