From ad7de479c93905215487344fc09cd2e5b2d6fa1f Mon Sep 17 00:00:00 2001 From: Greg Weresch Date: Mon, 12 Aug 2024 15:54:15 -0400 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Pereira --- .../v7/shared/app_summary_displayer_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/command/v7/shared/app_summary_displayer_test.go b/command/v7/shared/app_summary_displayer_test.go index 756a6f12251..87b4de373aa 100644 --- a/command/v7/shared/app_summary_displayer_test.go +++ b/command/v7/shared/app_summary_displayer_test.go @@ -682,10 +682,12 @@ var _ = Describe("app summary displayer", func() { var actualOut = fmt.Sprintf("%s", testUI.Out) Expect(actualOut).To(MatchRegexp(`Rolling deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) }) + It("displays max-in-flight value", func() { Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) + When("last status change has a timestamp and max-in-flight is default", func() { BeforeEach(func() { summary = v7action.DetailedApplicationSummary{ @@ -705,10 +707,12 @@ var _ = Describe("app summary displayer", func() { var actualOut = fmt.Sprintf("%s", testUI.Out) Expect(actualOut).To(MatchRegexp(`Rolling deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) }) + It("does not display max-in-flight", func() { Expect(testUI.Out).NotTo(Say(`max-in-flight`)) }) }) + // 'unset' is important for the newer-CLI-than-CAPI scenario When("last status change has a timestamp and max-in-flight is unset", func() { BeforeEach(func() { @@ -726,6 +730,7 @@ var _ = Describe("app summary displayer", func() { var actualOut = fmt.Sprintf("%s", testUI.Out) Expect(actualOut).To(MatchRegexp(`Rolling deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) }) + It("does not display max-in-flight", func() { Expect(testUI.Out).NotTo(Say(`max-in-flight`)) }) @@ -750,10 +755,12 @@ var _ = Describe("app summary displayer", func() { Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING`)) Expect(testUI.Out).NotTo(Say(`\(since`)) }) + It("displays max-in-flight value", func() { Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) + When("last status change is an empty string and max-in-flight is default", func() { BeforeEach(func() { summary = v7action.DetailedApplicationSummary{ @@ -773,6 +780,7 @@ var _ = Describe("app summary displayer", func() { Expect(testUI.Out).To(Say(`Rolling deployment currently DEPLOYING`)) Expect(testUI.Out).NotTo(Say(`\(since`)) }) + It("does not display max-in-flight", func() { Expect(testUI.Out).NotTo(Say(`max-in-flight`)) }) @@ -799,10 +807,12 @@ var _ = Describe("app summary displayer", func() { var actualOut = fmt.Sprintf("%s", testUI.Out) Expect(actualOut).To(MatchRegexp(`Rolling deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) }) + It("displays max-in-flight value", func() { Expect(testUI.Out).To(Say(`max-in-flight: 2`)) }) }) + When("max-in-flight value is default", func() { BeforeEach(func() { summary = v7action.DetailedApplicationSummary{ @@ -822,6 +832,7 @@ var _ = Describe("app summary displayer", func() { var actualOut = fmt.Sprintf("%s", testUI.Out) Expect(actualOut).To(MatchRegexp(`Rolling deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) }) + It("does not display max-in-flight", func() { Expect(testUI.Out).NotTo(Say(`max-in-flight`)) }) @@ -850,10 +861,12 @@ var _ = Describe("app summary displayer", func() { Expect(actualOut).To(MatchRegexp(`Canary deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) 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`)) }) }) + When("max-in-flight value is default", func() { BeforeEach(func() { summary = v7action.DetailedApplicationSummary{ @@ -874,6 +887,7 @@ var _ = Describe("app summary displayer", func() { Expect(actualOut).To(MatchRegexp(`Canary deployment currently DEPLOYING \(since %s\)`, dateTimeRegexPattern)) 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`)) }) @@ -906,6 +920,7 @@ var _ = Describe("app summary displayer", func() { Expect(actualOut).To(MatchRegexp(`Canary deployment currently PAUSED \(since %s\)`, dateTimeRegexPattern)) 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`)) }) @@ -935,6 +950,7 @@ var _ = Describe("app summary displayer", func() { Expect(actualOut).To(MatchRegexp(`Canary deployment currently PAUSED \(since %s\)`, dateTimeRegexPattern)) 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`)) }) @@ -962,6 +978,7 @@ var _ = Describe("app summary displayer", func() { Expect(actualOut).To(MatchRegexp(`Canary deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) 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`)) }) @@ -986,6 +1003,7 @@ var _ = Describe("app summary displayer", func() { Expect(actualOut).To(MatchRegexp(`Canary deployment currently CANCELING \(since %s\)`, dateTimeRegexPattern)) 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`)) }) @@ -1010,6 +1028,7 @@ var _ = Describe("app summary displayer", func() { cases.Title(language.English, cases.NoLower).String(string(summary.Deployment.Strategy)), summary.Deployment.StatusReason))) }) + It("does not display max-in-flight", func() { Expect(testUI.Out).NotTo(Say(`max-in-flight`)) })