diff --git a/api/cloudcontroller/ccv3/constant/deployment.go b/api/cloudcontroller/ccv3/constant/deployment.go index b35baa374c..2ae6159ebb 100644 --- a/api/cloudcontroller/ccv3/constant/deployment.go +++ b/api/cloudcontroller/ccv3/constant/deployment.go @@ -31,5 +31,3 @@ const ( DeploymentStatusValueActive DeploymentStatusValue = "ACTIVE" DeploymentStatusValueFinalized DeploymentStatusValue = "FINALIZED" ) - -const DeploymentMaxInFlightDefaultValue int = 1 diff --git a/command/v7/shared/app_summary_displayer.go b/command/v7/shared/app_summary_displayer.go index 1eab2046b3..46f7e84de2 100644 --- a/command/v7/shared/app_summary_displayer.go +++ b/command/v7/shared/app_summary_displayer.go @@ -2,6 +2,7 @@ package shared import ( "fmt" + "strconv" "strings" "time" @@ -13,8 +14,6 @@ import ( "code.cloudfoundry.org/cli/types" "code.cloudfoundry.org/cli/util/ui" log "github.com/sirupsen/logrus" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) type AppSummaryDisplayer struct { @@ -58,7 +57,7 @@ func (display AppSummaryDisplayer) AppDisplay(summary v7action.DetailedApplicati } } - display.UI.DisplayKeyValueTable("", keyValueTable, 3) + display.UI.DisplayKeyValueTable("", keyValueTable, ui.DefaultTableSpacePadding) if summary.LifecycleType == constant.AppLifecycleTypeBuildpack { display.displayBuildpackTable(summary.CurrentDroplet.Buildpacks) @@ -153,7 +152,7 @@ func (display AppSummaryDisplayer) displayProcessTable(summary v7action.Detailed startCommandRow, } - display.UI.DisplayKeyValueTable("", keyValueTable, 3) + display.UI.DisplayKeyValueTable("", keyValueTable, ui.DefaultTableSpacePadding) if len(process.InstanceDetails) == 0 { display.UI.DisplayText("There are no running instances of this process.") @@ -166,11 +165,19 @@ func (display AppSummaryDisplayer) displayProcessTable(summary v7action.Detailed display.UI.DisplayNewline() display.UI.DisplayText(display.getDeploymentStatusText(summary)) + var maxInFlightRow []string var maxInFlight = summary.Deployment.Options.MaxInFlight - if maxInFlight > 0 && maxInFlight != constant.DeploymentMaxInFlightDefaultValue { - display.UI.DisplayText(fmt.Sprintf("max-in-flight: %d", maxInFlight)) + if maxInFlight > 0 { + maxInFlightRow = append(maxInFlightRow, display.UI.TranslateText("max-in-flight:"), strconv.Itoa(maxInFlight)) } + keyValueTable := [][]string{ + {display.UI.TranslateText("strategy:"), strings.ToLower(string(summary.Deployment.Strategy))}, + maxInFlightRow, + } + + display.UI.DisplayKeyValueTable("", keyValueTable, ui.DefaultTableSpacePadding) + if summary.Deployment.Strategy == constant.DeploymentStrategyCanary && summary.Deployment.StatusReason == constant.DeploymentStatusReasonPaused { display.UI.DisplayNewline() display.UI.DisplayText(fmt.Sprintf("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", summary.Application.Name, summary.Application.Name)) @@ -181,13 +188,11 @@ func (display AppSummaryDisplayer) displayProcessTable(summary v7action.Detailed func (display AppSummaryDisplayer) getDeploymentStatusText(summary v7action.DetailedApplicationSummary) string { var lastStatusChangeTime = display.getLastStatusChangeTime(summary) if lastStatusChangeTime != "" { - return fmt.Sprintf("%s deployment currently %s (since %s)", - cases.Title(language.English, cases.NoLower).String(string(summary.Deployment.Strategy)), + return fmt.Sprintf("Active deployment with status %s (since %s)", summary.Deployment.StatusReason, lastStatusChangeTime) } else { - return fmt.Sprintf("%s deployment currently %s.", - cases.Title(language.English, cases.NoLower).String(string(summary.Deployment.Strategy)), + return fmt.Sprintf("Active deployment with status %s.", summary.Deployment.StatusReason) } } diff --git a/command/v7/shared/app_summary_displayer_test.go b/command/v7/shared/app_summary_displayer_test.go index be1d53d2af..9bf41061b1 100644 --- a/command/v7/shared/app_summary_displayer_test.go +++ b/command/v7/shared/app_summary_displayer_test.go @@ -1,7 +1,6 @@ package shared_test import ( - "fmt" "time" "code.cloudfoundry.org/cli/actor/v7action" @@ -14,8 +13,6 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gbytes" - "golang.org/x/text/cases" - "golang.org/x/text/language" ) var _ = Describe("app summary displayer", func() { @@ -679,11 +676,12 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) }) It("displays max-in-flight value", func() { - Expect(testUI.Out).To(Say(`max-in-flight: 2`)) + Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) @@ -703,11 +701,9 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) - }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) + Expect(testUI.Out).To(Say(`max-in-flight: 1`)) }) }) @@ -724,11 +720,9 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) - }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) + Expect(testUI.Out).ToNot(Say(`max-in-flight`)) }) }) @@ -748,12 +742,13 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING`)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING`)) Expect(testUI.Out).NotTo(Say(`\(since`)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) }) It("displays max-in-flight value", func() { - Expect(testUI.Out).To(Say(`max-in-flight: 2`)) + Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) @@ -773,12 +768,10 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING`)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING`)) Expect(testUI.Out).NotTo(Say(`\(since`)) - }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) + Expect(testUI.Out).To(Say(`max-in-flight: 1`)) }) }) }) @@ -800,11 +793,12 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) }) It("displays max-in-flight value", func() { - Expect(testUI.Out).To(Say(`max-in-flight: 2`)) + Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) @@ -824,11 +818,9 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Rolling deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) - }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) + Expect(testUI.Out).To(Say(`Active deployment with status CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: rolling`)) + Expect(testUI.Out).To(Say(`max-in-flight: 1`)) }) }) }) @@ -852,12 +844,13 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Canary deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: canary`)) Expect(testUI.Out).NotTo(Say(`promote the canary deployment`)) }) It("displays max-in-flight value", func() { - Expect(testUI.Out).To(Say(`max-in-flight: 2`)) + Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) @@ -877,12 +870,10 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Canary deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status DEPLOYING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: canary`)) Expect(testUI.Out).NotTo(Say(`promote the canary deployment`)) - }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) + Expect(testUI.Out).To(Say(`max-in-flight: 1`)) }) }) }) @@ -909,12 +900,13 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Canary deployment currently PAUSED \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status PAUSED \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: canary`)) Expect(testUI.Out).To(Say("Please run `cf continue-deployment foobar` to promote the canary deployment, or `cf cancel-deployment foobar` to rollback to the previous version.")) }) It("displays max-in-flight value", func() { - Expect(testUI.Out).To(Say(`max-in-flight: 2`)) + Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) @@ -939,13 +931,11 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Canary deployment currently PAUSED \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status PAUSED \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: canary`)) + Expect(testUI.Out).To(Say(`max-in-flight: 1`)) Expect(testUI.Out).To(Say("Please run `cf continue-deployment foobar` to promote the canary deployment, or `cf cancel-deployment foobar` to rollback to the previous version.")) }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) - }) }) }) @@ -966,12 +956,13 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Canary deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: canary`)) Expect(testUI.Out).NotTo(Say(`promote the canary deployment`)) }) It("displays max-in-flight value", func() { - Expect(testUI.Out).To(Say(`max-in-flight: 2`)) + Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) @@ -991,13 +982,11 @@ var _ = Describe("app summary displayer", func() { }) It("displays the message", func() { - Expect(testUI.Out).To(Say(`Canary deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`Active deployment with status CANCELING \(since %s\)`, dateTimeRegexPattern)) + Expect(testUI.Out).To(Say(`strategy: canary`)) + Expect(testUI.Out).To(Say(`max-in-flight: 1`)) Expect(testUI.Out).NotTo(Say(`promote the canary deployment`)) }) - - It("does not display max-in-flight", func() { - Expect(testUI.Out).NotTo(Say(`max-in-flight`)) - }) }) }) }) @@ -1015,9 +1004,7 @@ var _ = Describe("app summary displayer", func() { }) It("does not display deployment info", func() { - Expect(testUI.Out).NotTo(Say(fmt.Sprintf("%s deployment currently %s", - cases.Title(language.English, cases.NoLower).String(string(summary.Deployment.Strategy)), - summary.Deployment.StatusReason))) + Expect(testUI.Out).NotTo(Say(`Active deployment with status`)) }) It("does not display max-in-flight", func() { diff --git a/integration/v7/isolated/app_command_test.go b/integration/v7/isolated/app_command_test.go index 7c46f0317e..f99aa84243 100644 --- a/integration/v7/isolated/app_command_test.go +++ b/integration/v7/isolated/app_command_test.go @@ -264,26 +264,15 @@ applications: When("the deployment strategy is rolling", func() { When("the deployment is in progress", func() { It("displays the message", func() { - session := helpers.CF("restart", appName, "--strategy", "rolling") - - session1 := helpers.CF("app", appName) - Eventually(session1).Should(Say("Rolling deployment currently DEPLOYING")) - Eventually(session).Should(Exit(0)) - Eventually(session1).Should(Exit(0)) - }) - }) - When("the deployment is cancelled", func() { - It("displays the message", func() { - helpers.CF("restart", appName, "--strategy", "rolling") - Eventually(func() *Session { - return helpers.CF("cancel-deployment", appName).Wait() - }).Should(Exit(0)) + restartSession := helpers.CF("restart", appName, "--strategy", "rolling") Eventually(func(g Gomega) { session := helpers.CF("app", appName).Wait() - g.Expect(session).Should(Say("Rolling deployment currently CANCELING")) + g.Expect(session).Should(Say("Active deployment with status DEPLOYING")) + g.Expect(session).Should(Say("strategy: rolling")) g.Expect(session).Should(Exit(0)) }).Should(Succeed()) + Eventually(restartSession).Should(Exit(0)) }) }) }) @@ -294,7 +283,8 @@ applications: Eventually(helpers.CF("restart", appName, "--strategy", "canary")).Should(Exit(0)) session1 := helpers.CF("app", appName) - Eventually(session1).Should(Say("Canary deployment currently PAUSED")) + Eventually(session1).Should(Say("Active deployment with status PAUSED")) + Eventually(session1).Should(Say("strategy: canary")) Eventually(session1).Should(Exit(0)) }) }) @@ -306,7 +296,8 @@ applications: Eventually(func(g Gomega) { session := helpers.CF("app", appName).Wait() - g.Expect(session).Should(Say("Canary deployment currently CANCELING")) + g.Expect(session).Should(Say("Active deployment with status CANCELING")) + g.Expect(session).Should(Say("strategy: canary")) g.Expect(session).Should(Exit(0)) }).Should(Succeed()) }) @@ -324,7 +315,7 @@ applications: It("does not display the message", func() { session := helpers.CF("app", appName) Eventually(session).Should(Exit(0)) - Eventually(session).ShouldNot(Say(`\w+ deployment currently \w+`)) + Eventually(session).ShouldNot(Say(`Active deployment with status \w+`)) }) }) }) diff --git a/integration/v7/isolated/copy_source_command_test.go b/integration/v7/isolated/copy_source_command_test.go index e0495b4f05..a073cb64c9 100644 --- a/integration/v7/isolated/copy_source_command_test.go +++ b/integration/v7/isolated/copy_source_command_test.go @@ -388,8 +388,9 @@ var _ = Describe("copy-source command", func() { Eventually(session).Should(Say("Copying source from app %s to target app %s in org %s / space %s as %s...", sourceAppName, targetAppName, orgName, spaceName, username)) Eventually(session).Should(Say("Staging app %s in org %s / space %s as %s...", targetAppName, orgName, spaceName, username)) Eventually(session).Should(Say("Waiting for app to deploy...")) - Eventually(session).Should(Say("Canary deployment currently PAUSED")) - Eventually(session).ShouldNot(Say("max-in-flight")) + Eventually(session).Should(Say("Active deployment with status PAUSED")) + Eventually(session).Should(Say("strategy: canary")) + Eventually(session).Should(Say("max-in-flight: 1")) Eventually(session).Should(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", targetAppName, targetAppName)) Eventually(session).Should(Exit(0)) @@ -408,8 +409,9 @@ var _ = Describe("copy-source command", func() { Eventually(session).Should(Say("Copying source from app %s to target app %s in org %s / space %s as %s...", sourceAppName, targetAppName, orgName, spaceName, username)) Eventually(session).Should(Say("Staging app %s in org %s / space %s as %s...", targetAppName, orgName, spaceName, username)) Eventually(session).Should(Say("Waiting for app to deploy...")) - Eventually(session).Should(Say("Canary deployment currently PAUSED")) - Eventually(session).Should(Say("max-in-flight: 2")) + Eventually(session).Should(Say("Active deployment with status PAUSED")) + Eventually(session).Should(Say("strategy: canary")) + Eventually(session).Should(Say("max-in-flight: 2")) Eventually(session).Should(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", targetAppName, targetAppName)) Eventually(session).Should(Exit(0)) diff --git a/integration/v7/isolated/restage_command_test.go b/integration/v7/isolated/restage_command_test.go index d2d84c5201..8ff14a21b4 100644 --- a/integration/v7/isolated/restage_command_test.go +++ b/integration/v7/isolated/restage_command_test.go @@ -232,15 +232,16 @@ applications: }) When("strategy canary is given without the max-in-flight flag", func() { - It("restages successfully without noting max-in-flight", func() { + It("restages successfully and notes the max-in-flight value", func() { userName, _ := helpers.GetCredentials() session := helpers.CF("restage", appName, "--strategy", "canary") Consistently(session.Err).ShouldNot(Say(`This action will cause app downtime\.`)) Eventually(session).Should(Say(`Restaging app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName)) Eventually(session).Should(Say(`Creating deployment for app %s\.\.\.`, appName)) Eventually(session).Should(Say(`Waiting for app to deploy\.\.\.`)) - Eventually(session).Should(Say("Canary deployment currently PAUSED")) - Eventually(session).ShouldNot(Say("max-in-flight")) + Eventually(session).Should(Say("Active deployment with status PAUSED")) + Eventually(session).Should(Say("strategy: canary")) + Eventually(session).Should(Say("max-in-flight: 1")) Eventually(session).Should(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Eventually(session).Should(Exit(0)) }) @@ -254,8 +255,9 @@ applications: Eventually(session).Should(Say(`Restaging app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName)) Eventually(session).Should(Say(`Creating deployment for app %s\.\.\.`, appName)) Eventually(session).Should(Say(`Waiting for app to deploy\.\.\.`)) - Eventually(session).Should(Say("Canary deployment currently PAUSED")) - Eventually(session).Should(Say("max-in-flight: 2")) + Eventually(session).Should(Say("Active deployment with status PAUSED")) + Eventually(session).Should(Say("strategy: canary")) + Eventually(session).Should(Say("max-in-flight: 2")) Eventually(session).Should(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Eventually(session).Should(Exit(0)) }) diff --git a/integration/v7/isolated/restart_command_test.go b/integration/v7/isolated/restart_command_test.go index 64cad204ad..e3eb18877c 100644 --- a/integration/v7/isolated/restart_command_test.go +++ b/integration/v7/isolated/restart_command_test.go @@ -123,7 +123,7 @@ var _ = Describe("restart command", func() { Eventually(helpers.CustomCF(helpers.CFEnv{WorkingDirectory: appDir}, "push", appName)).Should(Exit(0)) }) }) - It("creates a deploy without noting max-in-flight", func() { + It("creates a deploy and notes the max-in-flight value", func() { session := helpers.CF("restart", appName, "--strategy=canary") Eventually(session).Should(Say(`Restarting app %s in org %s / space %s as %s\.\.\.`, appName, orgName, spaceName, userName)) Eventually(session).Should(Say(`Creating deployment for app %s\.\.\.`, appName)) @@ -136,8 +136,9 @@ var _ = Describe("restart command", func() { Eventually(session).Should(Say(`memory usage:\s+\d+(M|G)`)) Eventually(session).Should(Say(instanceStatsTitles)) Eventually(session).Should(Say(instanceStatsValues)) - Eventually(session).Should(Say("Canary deployment currently PAUSED")) - Eventually(session).ShouldNot(Say("max-in-flight")) + Eventually(session).Should(Say("Active deployment with status PAUSED")) + Eventually(session).Should(Say("strategy: canary")) + Eventually(session).Should(Say("max-in-flight: 1")) Eventually(session).Should(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Eventually(session).Should(Exit(0)) }) @@ -162,8 +163,9 @@ var _ = Describe("restart command", func() { Eventually(session).Should(Say(`memory usage:\s+\d+(M|G)`)) Eventually(session).Should(Say(instanceStatsTitles)) Eventually(session).Should(Say(instanceStatsValues)) - Eventually(session).Should(Say("Canary deployment currently PAUSED")) - Eventually(session).Should(Say("max-in-flight: 3")) + Eventually(session).Should(Say("Active deployment with status PAUSED")) + Eventually(session).Should(Say("strategy: canary")) + Eventually(session).Should(Say("max-in-flight: 3")) Eventually(session).Should(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Eventually(session).Should(Exit(0)) }) diff --git a/integration/v7/isolated/rollback_command_test.go b/integration/v7/isolated/rollback_command_test.go index 7a2875a934..e8c1b6c943 100644 --- a/integration/v7/isolated/rollback_command_test.go +++ b/integration/v7/isolated/rollback_command_test.go @@ -157,14 +157,15 @@ applications: Expect(err).ToNot(HaveOccurred()) }) - It("uses the given strategy to rollback without noting max-in-flight", func() { + It("uses the given strategy to rollback and notes the max-in-flight value", func() { session := helpers.CFWithStdin(buffer, "rollback", appName, "--version", "1", "--strategy", "canary") Eventually(session).Should(Exit(0)) Expect(session).To(HaveRollbackPrompt()) Expect(session).To(HaveRollbackOutput(appName, orgName, spaceName, userName)) - Expect(session).To(Say("Canary deployment currently PAUSED")) - Expect(session).NotTo(Say("max-in-flight")) + Expect(session).To(Say("Active deployment with status PAUSED")) + Expect(session).To(Say("strategy: canary")) + Expect(session).To(Say("max-in-flight: 1")) Expect(session).To(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Expect(session).To(Say("OK")) }) @@ -182,8 +183,9 @@ applications: Expect(session).To(HaveRollbackPrompt()) Expect(session).To(HaveRollbackOutput(appName, orgName, spaceName, userName)) - Expect(session).To(Say("Canary deployment currently PAUSED")) - Expect(session).To(Say("max-in-flight: 2")) + Expect(session).To(Say("Active deployment with status PAUSED")) + Expect(session).To(Say("strategy: canary")) + Expect(session).To(Say("max-in-flight: 2")) Expect(session).To(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Expect(session).To(Say("OK")) }) diff --git a/integration/v7/push/canary_push_test.go b/integration/v7/push/canary_push_test.go index 4fcbed184c..58a9e5cf58 100644 --- a/integration/v7/push/canary_push_test.go +++ b/integration/v7/push/canary_push_test.go @@ -31,7 +31,7 @@ var _ = Describe("push with --strategy canary", func() { }) When("the max-in-flight flag is not given", func() { - It("pushes the app and creates a new deployment without noting max-in-flight", func() { + It("pushes the app and creates a new deployment and notes the max-in-flight value", func() { helpers.WithHelloWorldApp(func(appDir string) { session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: appDir}, PushCommandName, appName, "--strategy", "canary", @@ -52,8 +52,9 @@ var _ = Describe("push with --strategy canary", func() { Expect(session).To(Say(`type:\s+web`)) Expect(session).To(Say(`start command:\s+%s`, helpers.StaticfileBuildpackStartCommand)) Expect(session).To(Say(`#0\s+running`)) - Expect(session).To(Say(`Canary deployment currently PAUSED`)) - Expect(session).ToNot(Say("max-in-flight")) + Expect(session).To(Say("Active deployment with status PAUSED")) + Expect(session).To(Say("strategy: canary")) + Expect(session).To(Say("max-in-flight: 1")) Expect(session).To(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Expect(session).To(Exit(0)) }) @@ -82,8 +83,9 @@ var _ = Describe("push with --strategy canary", func() { Expect(session).To(Say(`type:\s+web`)) Expect(session).To(Say(`start command:\s+%s`, helpers.StaticfileBuildpackStartCommand)) Expect(session).To(Say(`#0\s+running`)) - Expect(session).To(Say(`Canary deployment currently PAUSED`)) - Expect(session).To(Say("max-in-flight: 2")) + Expect(session).To(Say("Active deployment with status PAUSED")) + Expect(session).To(Say("strategy: canary")) + Expect(session).To(Say("max-in-flight: 2")) Expect(session).To(Say("Please run `cf continue-deployment %s` to promote the canary deployment, or `cf cancel-deployment %s` to rollback to the previous version.", appName, appName)) Expect(session).To(Exit(0)) })