Skip to content

Commit

Permalink
WIP: update existing test covering GetInstallation() to be retry frie…
Browse files Browse the repository at this point in the history
…ndly

Co-authored-by: Wayne Adams <[email protected]>
Co-authored-by: Marcela Lara <[email protected]>
  • Loading branch information
2 people authored and alejandra-lara committed Apr 8, 2024
1 parent e26bae3 commit 7a9fab3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commands/apply_changes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,14 @@ errands: lolololol
When("getting the installation status has an error", func() {
It("returns an error", func() {
service.CreateInstallationReturns(api.InstallationsServiceOutput{ID: 311}, nil)
service.GetInstallationReturnsOnCall(0, api.InstallationsServiceOutput{}, errors.New("another error"))
service.GetInstallationReturnsOnCall(0, api.InstallationsServiceOutput{}, errors.New("first error"))
service.GetInstallationReturnsOnCall(1, api.InstallationsServiceOutput{}, errors.New("second error"))
service.GetInstallationReturnsOnCall(2, api.InstallationsServiceOutput{}, errors.New("third error"))

command := commands.NewApplyChanges(service, pendingService, writer, logger, 1)

err := executeCommand(command, []string{})
Expect(err).To(MatchError("installation failed to get status: another error"))
Expect(err).To(MatchError("installation failed to get status after 3 attempts: third error"))
})
})

Expand Down

0 comments on commit 7a9fab3

Please sign in to comment.