Skip to content

Commit

Permalink
update tests to cover shutdown and updated recover in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
nouseforaname committed Sep 12, 2024
1 parent 46824db commit fcb7872
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ terraform {
random = {
source = "registry.terraform.io/hashicorp/random"
}
null = {
source = "registry.terraform.io/hashicorp/null"
}
}
}
resource "null_resource" "sleeper" {
provisioner "local-exec" {
command = "sleep 10"
}
}

resource "random_uuid" "random" {}

output provision_output { value = random_uuid.random.result }
output provision_output { value = random_uuid.random.result }
2 changes: 2 additions & 0 deletions integrationtest/fixtures/termination-recovery/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ terraform_binaries:
source: https://github.com/opentofu/opentofu/archive/refs/tags/v1.6.0.zip
- name: terraform-provider-random
version: 3.1.0
- name: terraform-provider-null
version: 3.2.2
service_definitions:
- fake-uuid-service.yml
16 changes: 13 additions & 3 deletions integrationtest/integrationtest_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
var _ = SynchronizedBeforeSuite(
func() []byte {
// -gcflags enabled "gops", but had to be removed as this doesn't compile with Go 1.19
//path, err := Build("github.com/cloudfoundry/cloud-service-broker", `-gcflags="all=-N -l"`)
// path, err := Build("github.com/cloudfoundry/cloud-service-broker", `-gcflags="all=-N -l"`)
path := must(Build("github.com/cloudfoundry/cloud-service-broker/v2"))
return []byte(path)
},
Expand All @@ -45,8 +45,18 @@ var _ = SynchronizedBeforeSuite(
)

var _ = SynchronizedAfterSuite(
func() {},
func() { CleanupBuildArtifacts() },
func() {
},
func() {
CleanupBuildArtifacts()
files, err := filepath.Glob("/tmp/brokerpak*")
Expect(err).ToNot(HaveOccurred())
for _, f := range files {
if err := os.RemoveAll(f); err != nil {
Expect(err).ToNot(HaveOccurred())
}
}
},
)

var _ = BeforeEach(func() {
Expand Down
Loading

0 comments on commit fcb7872

Please sign in to comment.