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

Fix compute-vm:CloudKMS test for provider>=4.54.0 #1196

Merged
merged 2 commits into from
Feb 28, 2023
Merged

Fix compute-vm:CloudKMS test for provider>=4.54.0 #1196

merged 2 commits into from
Feb 28, 2023

Conversation

dan-farmer
Copy link
Contributor

@dan-farmer dan-farmer commented Feb 28, 2023

Please sanity-check me that bumping the TF provider version is the right thing to do, and that I have done it appropriately.

The exact test in question is tests/examples/test_plan.py::test_example[modules/compute-vm:Disk encryption with Cloud KMS]. Aassertion copied below, for reference - line-breaks added for clarity:

AssertionError: disk_encryption_key at module.kms-vm-example.google_compute_disk.disks["attached-disk"] failed.

Got
`[{'kms_key_self_link': 'kms_key_self_link', 'kms_key_service_account': None, 'raw_key': None, 'rsa_encrypted_key': None}]`,

expected
`[{'kms_key_self_link': 'kms_key_self_link', 'kms_key_service_account': None, 'raw_key': None}]`

@ludoo
Copy link
Collaborator

ludoo commented Feb 28, 2023

Dan, thanks for this. We always update versions for the whole repo, using the default-versions.tf file in the root as a source. If you feel up to it, just bump versions there then run something like find . -name versions.tf -exec cp default-versions.tf "{}" \;.

* TF provider >= 4.54.0 now returns `rsa_encrypted_key` for
  `google_compute_disk.disks["attached-disk"]` (see
  hashicorp/terraform-provider-google#4448)
* Add this field to expected model to fix test assertion failure
* Update required TF provider to 4.55.0 (latest) since the assertion
  will now fail with <4.54.0, which do not return `rsa_encrypted_key`
  * Updated the whole repo on advice from @ludoo
@dan-farmer
Copy link
Contributor Author

Dan, thanks for this. We always update versions for the whole repo, using the default-versions.tf file in the root as a source. If you feel up to it, just bump versions there then run something like find . -name versions.tf -exec cp default-versions.tf "{}" \;.

@ludoo Done. Happy to make more changes as necessary - LMK.

@ludoo
Copy link
Collaborator

ludoo commented Feb 28, 2023

@ludoo Done. Happy to make more changes as necessary - LMK.

If you don't see a merge button once checks run ping me, I'll add you to the repo.

@dan-farmer dan-farmer merged commit 858bfe8 into GoogleCloudPlatform:master Feb 28, 2023
@dan-farmer dan-farmer deleted the fix-test-compute-vm-kms branch February 28, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants