Skip to content

Commit

Permalink
Merge pull request cloudfoundry#1636 from cloudfoundry-incubator/fix-…
Browse files Browse the repository at this point in the history
…165723266-make-tests-work-on-sapi-machines

Make integration tests less fragile and compatible with 4 char timezones
  • Loading branch information
Aarti Kriplani authored May 6, 2019
2 parents 5010c00 + 557d4c2 commit fab2846
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
13 changes: 11 additions & 2 deletions integration/shared/isolated/auth_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ var _ = Describe("auth command", func() {
When("no positional arguments are provided", func() {
Context("and no env variables are provided", func() {
It("errors-out with the help information", func() {
session := helpers.CF("auth")
envWithoutLoginInfo := map[string]string{
"CF_USERNAME": "",
"CF_PASSWORD": "",
}
session := helpers.CFWithEnv(envWithoutLoginInfo, "auth")
Eventually(session.Err).Should(Say("Username and password not provided."))
Eventually(session).Should(Say("NAME:"))

Expand Down Expand Up @@ -82,7 +86,11 @@ var _ = Describe("auth command", func() {

When("only a username is provided", func() {
It("errors-out with a password required error and the help information", func() {
session := helpers.CF("auth", "some-user")
envWithoutLoginInfo := map[string]string{
"CF_USERNAME": "",
"CF_PASSWORD": "",
}
session := helpers.CFWithEnv(envWithoutLoginInfo, "auth", "some-user")
Eventually(session.Err).Should(Say("Password not provided."))
Eventually(session).Should(Say("NAME:"))

Expand All @@ -93,6 +101,7 @@ var _ = Describe("auth command", func() {
When("only a password is provided", func() {
It("errors-out with a username required error and the help information", func() {
env := map[string]string{
"CF_USERNAME": "",
"CF_PASSWORD": "some-pass",
}
session := helpers.CFWithEnv(env, "auth")
Expand Down
2 changes: 1 addition & 1 deletion integration/shared/isolated/restage_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ applications:
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, domainName))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3} \d{4}`))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3,4} \d{4}`))
Eventually(session).Should(Say(`stack:\s+cflinuxfs`))
Eventually(session).Should(Say(`buildpacks:\s+staticfile`))
Eventually(session).Should(Say(`type:\s+web`))
Expand Down
2 changes: 1 addition & 1 deletion integration/shared/isolated/restart_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ applications:
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, domainName))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3} \d{4}`))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3,4} \d{4}`))
Eventually(session).Should(Say(`stack:\s+cflinuxfs`))
Eventually(session).Should(Say(`buildpacks:\s+staticfile`))
Eventually(session).Should(Say(`type:\s+web`))
Expand Down
4 changes: 2 additions & 2 deletions integration/shared/isolated/start_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ applications:
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, domainName))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3} \d{4}`))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3,4} \d{4}`))
Eventually(session).Should(Say(`stack:\s+cflinuxfs`))
Eventually(session).Should(Say(`buildpacks:\s+staticfile`))
Eventually(session).Should(Say(`type:\s+web`))
Expand Down Expand Up @@ -222,7 +222,7 @@ applications:
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, domainName))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3} \d{4}`))
Eventually(session).Should(Say(`last uploaded:\s+\w{3} \d{1,2} \w{3} \d{2}:\d{2}:\d{2} \w{3,4} \d{4}`))
Eventually(session).Should(Say(`stack:\s+cflinuxfs`))
Eventually(session).Should(Say(`buildpacks:\s+staticfile`))
Eventually(session).Should(Say(`type:\s+web`))
Expand Down
2 changes: 1 addition & 1 deletion integration/v6/isolated/app_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ applications:
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, domainName))
Eventually(session).Should(Say("last uploaded:\\s+\\w{3} \\d{1,2} \\w{3} \\d{2}:\\d{2}:\\d{2} \\w{3} \\d{4}"))
Eventually(session).Should(Say("last uploaded:\\s+\\w{3} \\d{1,2} \\w{3} \\d{2}:\\d{2}:\\d{2} \\w{3,4} \\d{4}"))
Eventually(session).Should(Say("stack:\\s+cflinuxfs"))
Eventually(session).Should(Say("buildpacks:\\s+staticfile"))
Eventually(session).Should(Say("type:\\s+web"))
Expand Down

0 comments on commit fab2846

Please sign in to comment.