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

Refactor HCP Vault TF acceptance tests for Azure #441

Merged
merged 10 commits into from
Jan 26, 2023
Merged

Conversation

codergs
Copy link
Contributor

@codergs codergs commented Jan 17, 2023

This PR adds acceptance tests with Azure cloud provider. Not all features are available under Azure cloud.

refactor is done so that we can use same code base for AWS And Azure cloud
separated out perf replication tests to a separate file - no refactor is done for this at the moment.
fixed a regression on perf replication test suites

🛠️ Description

🏗️ Acceptance tests

  • Are there any feature flags that are required to use this functionality?
  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

Wed Oct 12 16:48:43 EDT 2022 hashicorp/terraform-provider-hcp-internal - (codergs-HVT-2273) > TF_LOG_PATH=out.text TF_LOG=TRACE TF_ACC=1 go test ./internal/... -parallel 20 -v -run=TestAccVaultClusterAWS -timeout 210m     
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/clients    (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/consul     (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/input      (cached) [no tests to run]
=== RUN   TestAccVaultClusterAWS
=== PAUSE TestAccVaultClusterAWS
=== CONT  TestAccVaultClusterAWS
--- PASS: TestAccVaultClusterAWS (2630.25s)
PASS
ok      github.com/hashicorp/terraform-provider-hcp/internal/provider   2630.911s

@codergs codergs requested review from a team, helenfufu, biazmoreira and himran92 and removed request for biazmoreira and helenfufu January 17, 2023 15:19
@aoripov aoripov self-requested a review January 19, 2023 15:22
@hashicorp-cla
Copy link

hashicorp-cla commented Jan 19, 2023

CLA assistant check
All committers have signed the CLA.

@aoripov
Copy link
Contributor

aoripov commented Jan 19, 2023

@bcmdarroch I ran the tests locally:

~/projects/terraform-provider-hcp (codergs-HVT-2273)$ TF_LOG_PATH=out.text TF_LOG=TRACE TF_ACC=1 go test ./internal/... -parallel 20 -v -run=TestAccVaultClusterAWS -timeout 210m
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/clients	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/consul	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/input	(cached) [no tests to run]
=== RUN   TestAccVaultClusterAWS
=== PAUSE TestAccVaultClusterAWS
=== CONT  TestAccVaultClusterAWS
--- PASS: TestAccVaultClusterAWS (4451.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider	4452.169s

@codergs
Copy link
Contributor Author

codergs commented Jan 19, 2023

@aoripov @bcmdarroch can I please trouble you with azure tests too?

@aoripov
Copy link
Contributor

aoripov commented Jan 25, 2023

Azure tests:

TF_LOG_PATH=out.main.text TF_LOG=TRACE TF_ACC=1 go test ./internal/... -parallel 20 -v -run=TestAccVaultClusterAzure -timeout 240m
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/clients	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/consul	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/input	(cached) [no tests to run]
=== RUN   TestAccVaultClusterAzure
=== PAUSE TestAccVaultClusterAzure
=== CONT  TestAccVaultClusterAzure
--- PASS: TestAccVaultClusterAzure (4493.64s)
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/provider	4494.746s

@aoripov
Copy link
Contributor

aoripov commented Jan 25, 2023

AWS tests.
Ignore failure. It failed on the last step of deleting an HVN because of an increased cadence latency.

TF_LOG_PATH=out.main.text TF_LOG=TRACE TF_ACC=1 go test ./internal/... -parallel 20 -v -run=TestAccVaultClusterAWS -timeout 240m
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/clients	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/consul	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/input	(cached) [no tests to run]
=== RUN   TestAccVaultClusterAWS
=== PAUSE TestAccVaultClusterAWS
=== CONT  TestAccVaultClusterAWS
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: unable to delete HVN (test-hvn-aws-202301251324): context canceled waiting for delete HVN operation (5a81e5f1-b4b8-4a46-b801-8ef0fdb42c8b) to complete

--- FAIL: TestAccVaultClusterAWS (7092.17s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-hcp/internal/provider	7092.827s
FAIL

@aoripov
Copy link
Contributor

aoripov commented Jan 25, 2023

Performance replication tests. Same as with AWS tests they failed on the very last step - HVN deletion.

TF_LOG_PATH=repl.1.text TF_LOG=TRACE TF_ACC=1 go test ./internal/... -parallel 20 -v -run=TestAccPerformanceReplication_ValidationsAws -timeout 240m
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/clients	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/consul	(cached) [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/hashicorp/terraform-provider-hcp/internal/input	(cached) [no tests to run]
=== RUN   TestAccPerformanceReplication_ValidationsAws
    testing_new.go:84: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: unable to delete HVN (test-perf-hvn-2-202301251411): context canceled waiting for delete HVN operation (43daf7c0-f1bf-4e0f-a4d4-43bd64e6b9b5) to complete


        Error: unable to delete HVN (test-perf-hvn-1-202301251411): context canceled waiting for delete HVN operation (0e0d2f89-c6d1-4e80-bab5-b594a387f9f6) to complete

--- FAIL: TestAccPerformanceReplication_ValidationsAws (12984.60s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-hcp/internal/provider	12985.886s
FAIL

Copy link
Contributor Author

@codergs codergs left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the testing.

Copy link
Contributor

@bcmdarroch bcmdarroch left a comment

Choose a reason for hiding this comment

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

Did one final test and all the Vault tests passed. Thanks for fixing those IDs!

@bcmdarroch bcmdarroch merged commit ebb8440 into main Jan 26, 2023
@bcmdarroch bcmdarroch deleted the codergs-HVT-2273 branch January 26, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants