Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for DICOM store pubsub topic removal. #3442

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

xingao267
Copy link
Member

Release Note Template for Downstream PRs (will be copied)

healthcare: added tests for pubsub topic removal in `google_healthcare_dicom_store`

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 8 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 1 file changed, 8 insertions(+), 9 deletions(-))

@danawillow
Copy link
Contributor

Cloud build is failing because resource_healthcare_dicom_store_test.go needs to be gofmt-ted

@xingao267
Copy link
Member Author

/gcbrun

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@SirGitsalot, please review this PR or find an appropriate assignee.

@danawillow danawillow requested review from danawillow and removed request for SirGitsalot June 18, 2020 17:02
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 8 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 1 file changed, 8 insertions(+), 9 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=121427"

@xingao267
Copy link
Member Author

@danawillow thanks! fixed the format.

@danawillow
Copy link
Contributor

I ran the test and it failed, so there might be some code changes that need to be made also. Let me know if you want some help investigating.

Here's the failure:

------- Stdout: -------
=== RUN   TestAccHealthcareDicomStore_basic
=== PAUSE TestAccHealthcareDicomStore_basic
=== CONT  TestAccHealthcareDicomStore_basic
TestAccHealthcareDicomStore_basic: testing.go:674: Step 4 error: After applying this step, the plan was not empty:
DIFF:
UPDATE: google_healthcare_dicom_store.default
dataset:                            "projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w" => "projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w"
id:                                 "projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w/dicomStores/tf-test-dicom-store-i2iw0wucns" => "projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w/dicomStores/tf-test-dicom-store-i2iw0wucns"
labels.label1:                      "labelvalue1" => ""
name:                               "tf-test-dicom-store-i2iw0wucns" => "tf-test-dicom-store-i2iw0wucns"
notification_config.#:              "1" => "0"
notification_config.0.pubsub_topic: "projects/ci-test-project-188019/topics/tf-test-topic-cmj2b4sjbu" => ""
self_link:                          "projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w/dicomStores/tf-test-dicom-store-i2iw0wucns" => "projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w/dicomStores/tf-test-dicom-store-i2iw0wucns"
STATE:
google_healthcare_dataset.dataset:
ID = projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w
provider = provider.google
location = us-central1
name = tf-test-dataset-wnuetotr4w
project = ci-test-project-188019
self_link = projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w
time_zone = UTC
google_healthcare_dicom_store.default:
ID = projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w/dicomStores/tf-test-dicom-store-i2iw0wucns
provider = provider.google
dataset = projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w
labels.label1 = labelvalue1
name = tf-test-dicom-store-i2iw0wucns
notification_config.# = 1
notification_config.0.pubsub_topic = projects/ci-test-project-188019/topics/tf-test-topic-cmj2b4sjbu
self_link = projects/ci-test-project-188019/locations/us-central1/datasets/tf-test-dataset-wnuetotr4w/dicomStores/tf-test-dicom-store-i2iw0wucns
Dependencies:
google_healthcare_dataset.dataset
--- FAIL: TestAccHealthcareDicomStore_basic (12.94s)
FAIL

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 10 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 3 files changed, 10 insertions(+), 11 deletions(-))

@xingao267
Copy link
Member Author

@danawillow could you help rerun the test? The underlying dicom bug should now be fixed.

I tried to run it myself, but got the following error even with a clean copy of the terraform-provider-google.

$ make testacc TEST=./google TESTARGS='-run=TestAccHealthcareFhirStore*'
==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
go generate  ./...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google -v -run=TestAccHealthcareFhirStore* -timeout 240m -ldflags="-X=github.com/terraform-providers/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccHealthcareFhirStore_healthcareFhirStoreBasicExample
=== PAUSE TestAccHealthcareFhirStore_healthcareFhirStoreBasicExample
=== RUN   TestAccHealthcareFhirStore_healthcareFhirStoreStreamingConfigExample
=== PAUSE TestAccHealthcareFhirStore_healthcareFhirStoreStreamingConfigExample
=== RUN   TestAccHealthcareFhirStoreIamBinding
=== PAUSE TestAccHealthcareFhirStoreIamBinding
=== RUN   TestAccHealthcareFhirStoreIamMember
=== PAUSE TestAccHealthcareFhirStoreIamMember
=== RUN   TestAccHealthcareFhirStoreIamPolicy
=== PAUSE TestAccHealthcareFhirStoreIamPolicy
=== RUN   TestAccHealthcareFhirStoreIdParsing
=== PAUSE TestAccHealthcareFhirStoreIdParsing
=== RUN   TestAccHealthcareFhirStore_basic
=== PAUSE TestAccHealthcareFhirStore_basic
=== CONT  TestAccHealthcareFhirStore_healthcareFhirStoreBasicExample
=== CONT  TestAccHealthcareFhirStoreIamPolicy
=== CONT  TestAccHealthcareFhirStore_healthcareFhirStoreStreamingConfigExample
=== CONT  TestAccHealthcareFhirStoreIdParsing
=== CONT  TestAccHealthcareFhirStoreIamBinding
=== CONT  TestAccHealthcareFhirStore_basic
=== CONT  TestAccHealthcareFhirStoreIamMember
--- PASS: TestAccHealthcareFhirStoreIdParsing (0.01s)
panic: nil context

goroutine 776 [running]:
net/http.(*Request).WithContext(...)
	/usr/lib/google-golang/src/net/http/request.go:358
golang.org/x/net/context/ctxhttp.Do(0x0, 0x0, 0x4930580, 0xc001147000, 0x77df37dbca5083da, 0x10, 0x284a3e0)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/context/ctxhttp/ctxhttp.go:27 +0x324
golang.org/x/oauth2/internal.doTokenRoundTrip(0x0, 0x0, 0xc001147000, 0x48, 0xc00342dc40, 0x18)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/internal/token.go:232 +0x7b
golang.org/x/oauth2/internal.RetrieveToken(0x0, 0x0, 0xc0034b6000, 0x48, 0xc00342dc40, 0x18, 0x2f0465a, 0x23, 0xc002163380, 0x1, ...)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/internal/token.go:202 +0xdf
golang.org/x/oauth2.retrieveToken(0x0, 0x0, 0xc002018150, 0xc002163380, 0xc002163450, 0xc006855ebb, 0x1)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/token.go:157 +0x92
golang.org/x/oauth2.(*tokenRefresher).Token(0xc0067cf230, 0x5f13ad, 0x2eb3162, 0x6)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/oauth2.go:270 +0x1de
golang.org/x/oauth2.(*reuseTokenSource).Token(0xc000d41a20, 0x0, 0x0, 0x0)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/oauth2.go:304 +0xa8
golang.org/x/oauth2.(*Transport).RoundTrip(0xc000d41a60, 0xc001146f00, 0x0, 0x0, 0x0)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/golang.org/x/[email protected]/transport.go:45 +0x9e
github.com/hashicorp/terraform-plugin-sdk/helper/logging.(*transport).RoundTrip(0xc000d41a80, 0xc001146f00, 0xc0021636f0, 0x1, 0x1)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/github.com/hashicorp/[email protected]/helper/logging/transport.go:27 +0x164
github.com/terraform-providers/terraform-provider-google/google.(*retryTransport).RoundTrip(0xc0067cf530, 0xc0015f8900, 0x0, 0x0, 0x0)
	/usr/local/google/home/xingao/gitrepos/src/github.com/terraform-providers/terraform-provider-google/google/retry_transport.go:125 +0x2c5
net/http.send(0xc0015f8800, 0x3579b40, 0xc0067cf530, 0xbfbd9307a3945b21, 0x70e11c26f, 0x4930920, 0xc00217f3b0, 0xbfbd9307a3945b21, 0x1, 0x0)
	/usr/lib/google-golang/src/net/http/client.go:252 +0x43e
net/http.(*Client).send(0xc0067cf4a0, 0xc0015f8800, 0xbfbd9307a3945b21, 0x70e11c26f, 0x4930920, 0xc00217f3b0, 0x0, 0x1, 0xc000fc20a0)
	/usr/lib/google-golang/src/net/http/client.go:176 +0xfa
net/http.(*Client).do(0xc0067cf4a0, 0xc0015f8800, 0x0, 0x0, 0x0)
	/usr/lib/google-golang/src/net/http/client.go:699 +0x44a
net/http.(*Client).Do(...)
	/usr/lib/google-golang/src/net/http/client.go:567
github.com/terraform-providers/terraform-provider-google/google.sendRequestWithTimeout.func1(0xc001a10168, 0xc0010bc6a4)
	/usr/local/google/home/xingao/gitrepos/src/github.com/terraform-providers/terraform-provider-google/google/transport.go:82 +0x249
github.com/terraform-providers/terraform-provider-google/google.retryTimeDuration.func1(0x5dfc40)
	/usr/local/google/home/xingao/gitrepos/src/github.com/terraform-providers/terraform-provider-google/google/retry_utils.go:21 +0x32
github.com/hashicorp/terraform-plugin-sdk/helper/resource.Retry.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/github.com/hashicorp/[email protected]/helper/resource/wait.go:22 +0x5e
github.com/hashicorp/terraform-plugin-sdk/helper/resource.(*StateChangeConf).WaitForState.func1(0xc00089f980, 0xc001361500, 0xc003906100, 0xc000b20000, 0xc001e60930, 0xc001e60928)
	/usr/local/google/home/xingao/gitrepos/pkg/mod/github.com/hashicorp/[email protected]/helper/resource/state.go:103 +0x298
created by github.com/hashicorp/terraform-plugin-sdk/helper/resource.(*StateChangeConf).WaitForState
	/usr/local/google/home/xingao/gitrepos/pkg/mod/github.com/hashicorp/[email protected]/helper/resource/state.go:80 +0x1bf
FAIL	github.com/terraform-providers/terraform-provider-google/google	0.576s
FAIL
make: *** [GNUmakefile:14: testacc] Error 1

@danawillow
Copy link
Contributor

Hey, just wanted to pop in and let you know I haven't forgotten about this! I've had a bunch of other things on my plate, but I should be able to look at this again next week.

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass, thanks @xingao267!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants