From eca1163c9756da926e0637a318a0c41fd313f030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Pe=C3=B1a?= Date: Mon, 13 Nov 2023 11:04:47 -0500 Subject: [PATCH 1/2] Change status print to a info message when finishing a rolling deployment with --no-wait --- command/v7/shared/app_stager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/v7/shared/app_stager.go b/command/v7/shared/app_stager.go index 2f5e73ad4e0..b5d231e2be3 100644 --- a/command/v7/shared/app_stager.go +++ b/command/v7/shared/app_stager.go @@ -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 { From 53a784a00b8a6ab487d6aba673aa692c32d13995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristhian=20Pe=C3=B1a?= Date: Thu, 16 Nov 2023 15:09:36 -0500 Subject: [PATCH 2/2] Added test block for new message when restage with rolling strategy and --no-wait Co-authored-by: George Gelashvili --- command/v7/shared/app_stager_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/command/v7/shared/app_stager_test.go b/command/v7/shared/app_stager_test.go index 079c4736616..b2c094cb3fa 100644 --- a/command/v7/shared/app_stager_test.go +++ b/command/v7/shared/app_stager_test.go @@ -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() { @@ -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() { @@ -609,4 +636,5 @@ var _ = Describe("app stager", func() { Expect(executeErr).To(Not(HaveOccurred())) }) }) + })