Skip to content

Commit

Permalink
Change status query into a information message when finishing a rolli…
Browse files Browse the repository at this point in the history
…ng restage - main (#2666)

* Change status print to a info message when finishing a rolling deployment with --no-wait

* Added test block for new message when restage with rolling strategy and --no-wait

Co-authored-by: George Gelashvili <ggelashvili@vmware.com>

---------

Co-authored-by: George Gelashvili <ggelashvili@vmware.com>
  • Loading branch information
ccjaimes and pivotalgeorge authored Nov 20, 2023
1 parent 00ffc99 commit de13c02
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions command/v7/shared/app_stager.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func (stager *Stager) StartApp(
if err != nil {
return err
}
if noWait == true {
stager.UI.DisplayText("First instance restaged correctly, restaging remaining in the background")
return nil
}
} else {
user, err := stager.Actor.GetCurrentUser()
if err != nil {
Expand Down
28 changes: 28 additions & 0 deletions command/v7/shared/app_stager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ var _ = Describe("app stager", func() {
Expect(err).NotTo(HaveOccurred())
Expect(testUI.Out).To(Say(`Restarting app %s in org %s / space %s as %s\.\.\.`, app.Name, organization.Name, space.Name, user.Name))
Expect(testUI.Out).To(Say("Waiting for app to start..."))

})

When("staging fails", func() {
Expand Down Expand Up @@ -170,6 +171,32 @@ var _ = Describe("app stager", func() {
Expect(executeErr).To(MatchError("start-app-error"))
})
})

When("The deployment strategy is rolling with nowait", func() {
BeforeEach(func() {
strategy = constant.DeploymentStrategyRolling
noWait = true
appStager = shared.NewAppStager(fakeActor, testUI, fakeConfig, fakeLogCacheClient)
executeErr = appStager.StageAndStart(
app,
space,
organization,
pkgGUID,
strategy,
noWait,
appAction,
)
})

It("Restages and starts the app", func() {
Expect(executeErr).NotTo(HaveOccurred())

Expect(testUI.Out).To(Say("Creating deployment for app %s...", app.Name))
Expect(testUI.Out).To(Say("Waiting for app to deploy..."))

Expect(testUI.Out).To(Say("First instance restaged correctly, restaging remaining in the background"))
})
})
})

Context("StageApp", func() {
Expand Down Expand Up @@ -609,4 +636,5 @@ var _ = Describe("app stager", func() {
Expect(executeErr).To(Not(HaveOccurred()))
})
})

})

0 comments on commit de13c02

Please sign in to comment.