From 07fd1bd874a92b07d7064fe4cdce5652552dd2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Wed, 7 Aug 2024 13:09:58 -0500 Subject: [PATCH] Fix rollback and tests that check help text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- command/v7/rollback_command.go | 2 +- integration/v7/isolated/restage_command_test.go | 2 +- integration/v7/isolated/restart_command_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/command/v7/rollback_command.go b/command/v7/rollback_command.go index 26a53efdf0..9757d7bb7e 100644 --- a/command/v7/rollback_command.go +++ b/command/v7/rollback_command.go @@ -128,7 +128,7 @@ func (cmd RollbackCommand) Execute(args []string) error { func (cmd RollbackCommand) ValidateFlags() error { switch { - case cmd.MaxInFlight < 1: + case cmd.MaxInFlight < -1 || cmd.MaxInFlight == 0: return translatableerror.IncorrectUsageError{Message: "--max-in-flight must be greater than or equal to 1"} } diff --git a/integration/v7/isolated/restage_command_test.go b/integration/v7/isolated/restage_command_test.go index 9184c1b758..48cc84089f 100644 --- a/integration/v7/isolated/restage_command_test.go +++ b/integration/v7/isolated/restage_command_test.go @@ -31,7 +31,7 @@ var _ = Describe("restage command", func() { Eventually(session).Should(Say("ALIAS:")) Eventually(session).Should(Say("rg")) Eventually(session).Should(Say("OPTIONS:")) - Eventually(session).Should(Say("--strategy Deployment strategy can be canary, rolling or null")) + Eventually(session).Should(Say(`--strategy\s+Deployment strategy can be canary, rolling or null`)) Eventually(session).Should(Say("--max-in-flight")) Eventually(session).Should(Say("--no-wait Exit when the first instance of the web process is healthy")) Eventually(session).Should(Say("ENVIRONMENT:")) diff --git a/integration/v7/isolated/restart_command_test.go b/integration/v7/isolated/restart_command_test.go index 077d6f6c85..13aff013a9 100644 --- a/integration/v7/isolated/restart_command_test.go +++ b/integration/v7/isolated/restart_command_test.go @@ -51,8 +51,8 @@ var _ = Describe("restart command", func() { Eventually(session).Should(Say("ALIAS:")) Eventually(session).Should(Say("rs")) Eventually(session).Should(Say("OPTIONS:")) - Eventually(session).Should(Say("--strategy Deployment strategy can be canary, rolling or null.")) - Eventually(session).Should(Say("--no-wait Exit when the first instance of the web process is healthy")) + Eventually(session).Should(Say(`--strategy\s+Deployment strategy can be canary, rolling or null.`)) + Eventually(session).Should(Say(`--no-wait\s+Exit when the first instance of the web process is healthy`)) Eventually(session).Should(Say("--max-in-flight")) Eventually(session).Should(Say("ENVIRONMENT:")) Eventually(session).Should(Say(`CF_STAGING_TIMEOUT=15\s+Max wait time for staging, in minutes`))