(t *testing.T)
| 499 | } |
| 500 | |
| 501 | func TestChange_PlanChecks_PollFailure(t *testing.T) { |
| 502 | mock := newChangeMock(employeeDB()) |
| 503 | mock.planCheckRunStatus = http.StatusInternalServerError |
| 504 | mock.issueResponse = defaultIssueResponse("APPROVED") |
| 505 | s := newChangeTestServer(t, mock) |
| 506 | |
| 507 | _, structured, err := s.handleChange(testContext(), nil, ChangeInput{ |
| 508 | Database: "employee_db", |
| 509 | SQL: "ALTER TABLE x ADD COLUMN y INT", |
| 510 | Title: "Test", |
| 511 | }) |
| 512 | require.NoError(t, err) |
| 513 | |
| 514 | output, ok := structured.(*ChangeOutput) |
| 515 | require.True(t, ok) |
| 516 | require.NotNil(t, output.PlanChecks) |
| 517 | require.Equal(t, "RUNNING", output.PlanChecks.Status) |
| 518 | // Issue still created. |
| 519 | require.NotEmpty(t, output.Issue) |
| 520 | } |
| 521 | |
| 522 | // --- Rollout gating tests --- |
| 523 |
nothing calls this directly
no test coverage detected