Skip to content

Commit

Permalink
autoupdate: tests: define expected number of calls in tests exactly
Browse files Browse the repository at this point in the history
  • Loading branch information
fho committed Dec 14, 2021
1 parent c3bdcac commit 2ff0a83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/autoupdate/autoupdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ func TestReviewApprovedEventResumesSuspendedPR(t *testing.T) {
assert.Len(t, queue.suspended, 1)

mockSuccessfulPullRequestIsApprovedCall(ghClient, prNumber).Times(2)
mockSuccessfulGithubUpdateBranchCall(ghClient, prNumber, true).AnyTimes()
mockSuccessfulGithubUpdateBranchCall(ghClient, prNumber, true).Times(1)

evChan <- &github_prov.Event{Event: newPullRequestReviewEvent(prNumber, prBranch, baseBranch, "submitted", "approved")}
waitForProcessedEventCnt(t, autoupdater, 2)
Expand All @@ -1104,7 +1104,7 @@ func TestDismissingApprovalSuspendsActivePR(t *testing.T) {
triggerLabel := "queue-add"

mockPullRequestIsApprovedCall(ghClient, prNumber, true).Times(1)
mockSuccessfulGithubUpdateBranchCall(ghClient, prNumber, true).AnyTimes()
mockSuccessfulGithubUpdateBranchCall(ghClient, prNumber, true).Times(1)

retryer := goordinator.NewRetryer()
autoupdater := NewAutoupdater(
Expand Down Expand Up @@ -1147,7 +1147,7 @@ func TestRequestingReviewChangesSuspendsPR(t *testing.T) {
triggerLabel := "queue-add"

mockPullRequestIsApprovedCall(ghClient, prNumber, true).Times(1)
mockSuccessfulGithubUpdateBranchCall(ghClient, prNumber, true).AnyTimes()
mockSuccessfulGithubUpdateBranchCall(ghClient, prNumber, true).Times(1)

retryer := goordinator.NewRetryer()
autoupdater := NewAutoupdater(
Expand Down

0 comments on commit 2ff0a83

Please sign in to comment.