Skip to content

Commit 2a3b3ca

Browse files
Change status query into a information message when finishing a rolling restage (#2664)
* 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 <[email protected]> --------- Co-authored-by: George Gelashvili <[email protected]>
1 parent b7dcdf6 commit 2a3b3ca

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

command/v7/shared/app_stager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ func (stager *Stager) StartApp(
172172
if err != nil {
173173
return err
174174
}
175+
if noWait == true {
176+
stager.UI.DisplayText("First instance restaged correctly, restaging remaining in the background")
177+
return nil
178+
}
175179
} else {
176180
user, err := stager.Actor.GetCurrentUser()
177181
if err != nil {

command/v7/shared/app_stager_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ var _ = Describe("app stager", func() {
125125
Expect(err).NotTo(HaveOccurred())
126126
Expect(testUI.Out).To(Say(`Restarting app %s in org %s / space %s as %s\.\.\.`, app.Name, organization.Name, space.Name, user.Name))
127127
Expect(testUI.Out).To(Say("Waiting for app to start..."))
128+
128129
})
129130

130131
When("staging fails", func() {
@@ -170,6 +171,32 @@ var _ = Describe("app stager", func() {
170171
Expect(executeErr).To(MatchError("start-app-error"))
171172
})
172173
})
174+
175+
When("The deployment strategy is rolling with nowait", func() {
176+
BeforeEach(func() {
177+
strategy = constant.DeploymentStrategyRolling
178+
noWait = true
179+
appStager = shared.NewAppStager(fakeActor, testUI, fakeConfig, fakeLogCacheClient)
180+
executeErr = appStager.StageAndStart(
181+
app,
182+
space,
183+
organization,
184+
pkgGUID,
185+
strategy,
186+
noWait,
187+
appAction,
188+
)
189+
})
190+
191+
It("Restages and starts the app", func() {
192+
Expect(executeErr).NotTo(HaveOccurred())
193+
194+
Expect(testUI.Out).To(Say("Creating deployment for app %s...", app.Name))
195+
Expect(testUI.Out).To(Say("Waiting for app to deploy..."))
196+
197+
Expect(testUI.Out).To(Say("First instance restaged correctly, restaging remaining in the background"))
198+
})
199+
})
173200
})
174201

175202
Context("StageApp", func() {
@@ -609,4 +636,5 @@ var _ = Describe("app stager", func() {
609636
Expect(executeErr).To(Not(HaveOccurred()))
610637
})
611638
})
639+
612640
})

0 commit comments

Comments
 (0)