Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: João Pereira <joaopapereira@gmail.com>
  • Loading branch information
weresch and joaopapereira authored Aug 12, 2024
1 parent 9017f66 commit ad7de47
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions command/v7/shared/app_summary_displayer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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() {
Expand All @@ -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`))
})
Expand All @@ -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{
Expand All @@ -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`))
})
Expand All @@ -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{
Expand All @@ -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`))
})
Expand Down Expand Up @@ -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{
Expand All @@ -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`))
})
Expand Down Expand Up @@ -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`))
})
Expand Down Expand Up @@ -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`))
})
Expand Down Expand Up @@ -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`))
})
Expand All @@ -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`))
})
Expand All @@ -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`))
})
Expand Down

0 comments on commit ad7de47

Please sign in to comment.