Skip to content

Commit

Permalink
Update rolling deploy timeout test to validate the deployment has been
Browse files Browse the repository at this point in the history
canceled

Co-authored-by: Jenna Goldstrich <[email protected]>
Co-authored-by: Seth Boyles <[email protected]>
  • Loading branch information
2 people authored and Teal Stannard committed May 27, 2021
1 parent 61677f2 commit 8744231
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions integration/v7/push/rolling_push_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package push

import (
"fmt"

"code.cloudfoundry.org/cli/integration/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -34,21 +36,21 @@ var _ = Describe("push with --strategy rolling", func() {
PushCommandName, appName, "--strategy", "rolling",
)

Eventually(session).Should(Say(`Pushing app %s to org %s / space %s as %s\.\.\.`, appName, organization, space, userName))
Eventually(session).Should(Say(`Packaging files to upload\.\.\.`))
Eventually(session).Should(Say(`Uploading files\.\.\.`))
Eventually(session).Should(Say(`100.00%`))
Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`))
Eventually(session).Should(Say(`Staging app and tracing logs\.\.\.`))
Eventually(session).Should(Say(`Starting deployment for app %s\.\.\.`, appName))
Eventually(session).Should(Say(`Waiting for app to deploy\.\.\.`))
Eventually(session).Should(Say(`name:\s+%s`, appName))
Eventually(session).Should(Say(`requested state:\s+started`))
Eventually(session).Should(Say(`routes:\s+%s.%s`, appName, helpers.DefaultSharedDomain()))
Eventually(session).Should(Say(`type:\s+web`))
Eventually(session).Should(Say(`start command:\s+%s`, helpers.StaticfileBuildpackStartCommand))
Eventually(session).Should(Say(`#0\s+running`))
Eventually(session).Should(Exit(0))
Expect(session).To(Say(`Pushing app %s to org %s / space %s as %s\.\.\.`, appName, organization, space, userName))
Expect(session).To(Say(`Packaging files to upload\.\.\.`))
Expect(session).To(Say(`Uploading files\.\.\.`))
Expect(session).To(Say(`100.00%`))
Expect(session).To(Say(`Waiting for API to complete processing files\.\.\.`))
Expect(session).To(Say(`Staging app and tracing logs\.\.\.`))
Expect(session).To(Say(`Starting deployment for app %s\.\.\.`, appName))
Expect(session).To(Say(`Waiting for app to deploy\.\.\.`))
Expect(session).To(Say(`name:\s+%s`, appName))
Expect(session).To(Say(`requested state:\s+started`))
Expect(session).To(Say(`routes:\s+%s.%s`, appName, helpers.DefaultSharedDomain()))
Expect(session).To(Say(`type:\s+web`))
Expect(session).To(Say(`start command:\s+%s`, helpers.StaticfileBuildpackStartCommand))
Expect(session).To(Say(`#0\s+running`))
})
})
})
Expand Down Expand Up @@ -100,19 +102,25 @@ var _ = Describe("push with --strategy rolling", func() {
WorkingDirectory: appDir,
EnvVars: map[string]string{"CF_STARTUP_TIMEOUT": "0.1"},
}, PushCommandName, appName, "--strategy", "rolling")
Eventually(session).Should(Say(`Pushing app %s to org %s / space %s as %s\.\.\.`, appName, organization, space, userName))
Eventually(session).Should(Say(`Packaging files to upload\.\.\.`))
Eventually(session).Should(Say(`Uploading files\.\.\.`))
Eventually(session).Should(Say(`100.00%`))
Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`))
Eventually(session).Should(Say(`Staging app and tracing logs\.\.\.`))
Eventually(session).Should(Say(`Starting deployment for app %s\.\.\.`, appName))
Eventually(session).Should(Say(`Waiting for app to deploy\.\.\.`))
Eventually(session).Should(Say(`FAILED`))
Eventually(session.Err).Should(Say(`Start app timeout`))
Eventually(session.Err).Should(Say(`TIP: Application must be listening on the right port\. Instead of hard coding the port, use the \$PORT environment variable\.`))
Eventually(session.Err).Should(Say(`Use 'cf logs %s --recent' for more information`, appName))
Eventually(session).Should(Exit(1))
Expect(session).To(Say(`Pushing app %s to org %s / space %s as %s\.\.\.`, appName, organization, space, userName))
Expect(session).To(Say(`Packaging files to upload\.\.\.`))
Expect(session).To(Say(`Uploading files\.\.\.`))
Expect(session).To(Say(`100.00%`))
Expect(session).To(Say(`Waiting for API to complete processing files\.\.\.`))
Expect(session).To(Say(`Staging app and tracing logs\.\.\.`))
Expect(session).To(Say(`Starting deployment for app %s\.\.\.`, appName))
Expect(session).To(Say(`Waiting for app to deploy\.\.\.`))
Expect(session).To(Say(`FAILED`))
Expect(session.Err).To(Say(`Start app timeout`))
Expect(session.Err).To(Say(`TIP: Application must be listening on the right port\. Instead of hard coding the port, use the \$PORT environment variable\.`))
Expect(session.Err).To(Say(`Use 'cf logs %s --recent' for more information`, appName))
appGUID := helpers.AppGUID(appName)
Eventually(func() *Buffer {
session_deployment := helpers.CF("curl", fmt.Sprintf("/v3/deployments?app_guids=%s", appGUID))
Eventually(session_deployment).Should(Exit(0))
return session_deployment.Out
}).Should(Say(`"reason":\s*"CANCELED"`))
})
})
})
Expand Down

0 comments on commit 8744231

Please sign in to comment.