Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit cb93ed3

Browse files
committed
reorder cleanup funcs
1 parent 62fcb11 commit cb93ed3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/example_postgres_replicas_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ func TestPostgresReplicas(t *testing.T) {
4545
test_structure.SaveString(t, exampleDir, KEY_PROJECT, projectId)
4646
})
4747

48+
// AT THE END OF THE TESTS, RUN `terraform destroy`
49+
// TO CLEAN UP ANY RESOURCES THAT WERE CREATED
50+
defer test_structure.RunTestStage(t, "teardown", func() {
51+
terraformOptions := test_structure.LoadTerraformOptions(t, exampleDir)
52+
terraform.Destroy(t, terraformOptions)
53+
})
54+
4855
// AT THE END OF THE TESTS, CLEAN UP ANY POSTGRES OBJECTS THAT WERE CREATED
4956
defer test_structure.RunTestStage(t, "cleanup_postgres_objects", func() {
5057
terraformOptions := test_structure.LoadTerraformOptions(t, exampleDir)
@@ -68,13 +75,6 @@ func TestPostgresReplicas(t *testing.T) {
6875
}
6976
})
7077

71-
// AT THE END OF THE TESTS, RUN `terraform destroy`
72-
// TO CLEAN UP ANY RESOURCES THAT WERE CREATED
73-
defer test_structure.RunTestStage(t, "teardown", func() {
74-
terraformOptions := test_structure.LoadTerraformOptions(t, exampleDir)
75-
terraform.Destroy(t, terraformOptions)
76-
})
77-
7878
test_structure.RunTestStage(t, "deploy", func() {
7979
region := test_structure.LoadString(t, exampleDir, KEY_REGION)
8080
projectId := test_structure.LoadString(t, exampleDir, KEY_PROJECT)

0 commit comments

Comments
 (0)