Skip to content

Commit

Permalink
test: Adding test assertions to validate bindings work after an upgra…
Browse files Browse the repository at this point in the history
…de (#1234)

Also we now know that it is possible to do a noop update so replacing all updates with noop updates to make tests quicker

[#187814867](https://www.pivotaltracker.com/story/show/187814867)

Co-authored-by: George Blue <blgm@users.noreply.github.com>
  • Loading branch information
FelisiaM and blgm committed Jun 20, 2024
1 parent 4aa860c commit dc0c4d2
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = Describe("UpgradeDataprocTest", Label("dataproc"), func() {
Expect(appOne.GET(jobName).String()).To(Equal("DONE"))

By("updating the instance config params")
serviceInstance.Update(services.WithParameters(`{"worker_count":3}`))
serviceInstance.Update(services.WithParameters(`{}`))

By("checking the job status is still accessible")
Expect(appOne.GET(jobName).String()).To(Equal("DONE"))
Expand Down
13 changes: 11 additions & 2 deletions acceptance-tests/upgrade/update_and_upgrade_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,22 @@ var _ = Describe("UpgradeMYSQLTest", Label("mysql"), func() {
By("getting the value using the second app")
Expect(appTwo.GET("/key-value/%s", key).String()).To(Equal(value))

By("deleting bindings created before the upgrade")
bindingOne.Unbind()
bindingTwo.Unbind()

By("creating new bindings and testing they still work")
serviceInstance.Bind(appOne)
serviceInstance.Bind(appTwo)
apps.Restage(appOne, appTwo)

By("updating the instance plan")
serviceInstance.Update(services.WithPlan("default"))
serviceInstance.Update(services.WithParameters(`{}`))

By("getting the value using the second app")
Expect(appTwo.GET("/key-value/%s", key).String()).To(Equal(value))

By("deleting bindings created before the upgrade")
By("deleting bindings created before the update")
bindingOne.Unbind()
bindingTwo.Unbind()

Expand Down
13 changes: 11 additions & 2 deletions acceptance-tests/upgrade/update_and_upgrade_postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,23 @@ var _ = Describe("UpgradePostgreSQLTest", Label("postgresql"), func() {
got = appTwo.GET("%s/%s", schema, keyOne).String()
Expect(got).To(Equal(valueOne))

By("deleting bindings created before the upgrade")
bindingOne.Unbind()
bindingTwo.Unbind()

By("creating new bindings and testing they still work")
serviceInstance.Bind(appOne)
serviceInstance.Bind(appTwo)
apps.Restage(appOne, appTwo)

By("updating the instance plan")
serviceInstance.Update(services.WithPlan("medium"))
serviceInstance.Update(services.WithParameters(`{}`))

By("checking previously written data still accessible")
got = appTwo.GET("%s/%s", schema, keyOne).String()
Expect(got).To(Equal(valueOne))

By("deleting bindings created before the upgrade")
By("deleting bindings created before the update")
bindingOne.Unbind()
bindingTwo.Unbind()

Expand Down
13 changes: 11 additions & 2 deletions acceptance-tests/upgrade/update_and_upgrade_redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,17 @@ var _ = Describe("UpgradeRedisTest", Label("redis"), func() {
By("getting the value using the second app")
Expect(appTwo.GET(key1).String()).To(Equal(value1))

By("updating the instance plan")
serviceInstance.Update(services.WithParameters(`{"memory_size_gb":6}`))
By("deleting bindings created before the upgrade")
bindingOne.Unbind()
bindingTwo.Unbind()

By("creating new bindings and testing they still work")
serviceInstance.Bind(appOne)
serviceInstance.Bind(appTwo)
apps.Restage(appOne, appTwo)

By("triggering a no-op update to reapply the terraform for service instance")
serviceInstance.Update(services.WithParameters(`{}`))

By("getting the value using the second app")
Expect(appTwo.GET(key1).String()).To(Equal(value1))
Expand Down
19 changes: 16 additions & 3 deletions acceptance-tests/upgrade/update_and_upgrade_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ var _ = Describe("UpgradeStorageTest", Label("storage"), func() {
got = appTwo.GET(blobNameOne).String()
Expect(got).To(Equal(blobDataOne))

By("re-applying the terraform for service instance")
serviceInstance.Update(services.WithParameters(`{"uniform_bucket_level_access": true}`))

By("deleting bindings created before the upgrade")
bindingOne.Unbind()
bindingTwo.Unbind()
Expand All @@ -70,6 +67,22 @@ var _ = Describe("UpgradeStorageTest", Label("storage"), func() {
serviceInstance.BindWithParams(appTwo, `{"role":"storage.objectAdmin"}`)
apps.Restage(appOne, appTwo)

By("triggering a no-op update to reapply the terraform for service instance")
serviceInstance.Update(services.WithParameters(`{}`))

By("checking that previously written data is accessible")
got = appTwo.GET(blobNameOne).String()
Expect(got).To(Equal(blobDataOne))

By("deleting bindings created before the update")
bindingOne.Unbind()
bindingTwo.Unbind()

By("creating new bindings and testing they still work")
serviceInstance.BindWithParams(appOne, `{"role":"storage.objectAdmin"}`)
serviceInstance.BindWithParams(appTwo, `{"role":"storage.objectAdmin"}`)
apps.Restage(appOne, appTwo)

By("checking that previously written data is accessible")
got = appTwo.GET(blobNameOne).String()
Expect(got).To(Equal(blobDataOne))
Expand Down

0 comments on commit dc0c4d2

Please sign in to comment.