Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change status query into a information message when finishing a rolling restage - v7 #2665

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions command/v7/shared/app_stager.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,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.Config.CurrentUser()
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()))
})
})

})
Loading