(t *testing.T)
| 407 | } |
| 408 | |
| 409 | func 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 | } |
nothing calls this directly
no test coverage detected