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

Function TestUpdateListsAllUnresolvedPRs

tools/chloggen/cmd/update_test.go:409–441  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

407}
408
409func TestUpdateListsAllUnresolvedPRs(t *testing.T) {
410 globalCfg = config.New(t.TempDir())
411
412 // Two unresolvable entries plus one with an explicit issue: both unresolved
413 // files must appear in a single error, not just the first.
414 resolvable := &chlog.Entry{
415 ChangeType: chlog.Enhancement,
416 Component: "receiver/foo",
417 Note: "Has a PR",
418 Issues: []int{42},
419 User: "octocat",
420 }
421 missingA := &chlog.Entry{
422 ChangeType: chlog.BugFix,
423 Component: "receiver/foo",
424 Note: "Missing A",
425 User: "octocat",
426 }
427 missingB := &chlog.Entry{
428 ChangeType: chlog.BugFix,
429 Component: "receiver/foo",
430 Note: "Missing B",
431 User: "octocat",
432 }
433 setupTestDir(t, []*chlog.Entry{resolvable, missingA, missingB})
434
435 _, err := runCobra(t, "update")
436 require.ErrorContains(t, err, "could not determine a PR number for 2 changelog")
437 // setupTestDir writes entries as 0.yaml (resolvable), 1.yaml, 2.yaml.
438 assert.ErrorContains(t, err, "1.yaml")
439 assert.ErrorContains(t, err, "2.yaml")
440 assert.NotContains(t, err.Error(), "0.yaml")
441}

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