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

Remove references to deleted compute images in multiple tests #12062

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

SirGitsalot
Copy link
Member

@SirGitsalot SirGitsalot commented Oct 18, 2024

There are multiple tests that refer to preconfigured images in the bosh-gce-raw-stemcells storage bucket. That bucket was deleted recently, so the tests began failing. That bucket was at least five years old and we never controlled it (bosh is a Cloud Foundry tool), so it was bound to happen.

Replacing the missing bucket with another preconfigured bucket will just kick the can down the road, so the tests are updated to no longer require one. There's three different fixes applied in this PR:

  • Where possible, the dependency on the google_compute_image resource was removed. These are tests that are not testing google_compute_image at all (and were likely copied and pasted from other tests that do).
  • Uploading and referencing a raw-disk-image.tar.gz file, which is a valid but small disk image (it's mostly zeros so it compresses down to about 3KB). The tests using this method are replicating their earlier behavior, but without the preconfigured bucket.
  • For generated tests, a new disk is created and the google_compute_image references that disk. This is a bit slower than the second method but doesn't rely on a test fixture so the tests can continue to be generated.

Fixes hashicorp/terraform-provider-google#19885
Fixes hashicorp/terraform-provider-google#19729

Release Note Template for Downstream PRs (will be copied)


@github-actions github-actions bot requested a review from NickElliot October 18, 2024 20:48
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 369 insertions(+), 143 deletions(-))
google-beta provider: Diff ( 8 files changed, 369 insertions(+), 143 deletions(-))
Open in Cloud Shell: Diff ( 3 files changed, 55 insertions(+), 10 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1036
Passed tests: 948
Skipped tests: 73
Affected tests: 15

Click here to see the affected service packages
  • compute

Action taken

Found 15 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeImageIamBindingGenerated
  • TestAccComputeImageIamBindingGenerated_withCondition
  • TestAccComputeImageIamMemberGenerated
  • TestAccComputeImageIamMemberGenerated_withCondition
  • TestAccComputeImageIamPolicyGenerated
  • TestAccComputeImageIamPolicyGenerated_withCondition
  • TestAccComputeImage_imageBasicExample
  • TestAccComputeImage_imageBasicStorageLocationExample
  • TestAccComputeImage_imageGuestOsExample
  • TestAccComputeImage_update
  • TestAccComputeInstanceTemplate_imageShorthand
  • TestAccComputeInstanceTemplate_nictype_update
  • TestAccComputeInstance_nictype_update
  • TestAccComputeRegionInstanceTemplate_imageShorthand
  • TestAccComputeRegionInstanceTemplate_nictype_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeImageIamPolicyGenerated_withCondition [Debug log]
TestAccComputeImage_update [Debug log]
TestAccComputeInstanceTemplate_imageShorthand [Debug log]
TestAccComputeInstanceTemplate_nictype_update [Debug log]
TestAccComputeInstance_nictype_update [Debug log]
TestAccComputeRegionInstanceTemplate_imageShorthand [Debug log]
TestAccComputeRegionInstanceTemplate_nictype_update [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccComputeImageIamBindingGenerated [Error message] [Debug log]
TestAccComputeImageIamBindingGenerated_withCondition [Error message] [Debug log]
TestAccComputeImageIamMemberGenerated [Error message] [Debug log]
TestAccComputeImageIamMemberGenerated_withCondition [Error message] [Debug log]
TestAccComputeImageIamPolicyGenerated [Error message] [Debug log]
TestAccComputeImage_imageBasicExample [Error message] [Debug log]
TestAccComputeImage_imageBasicStorageLocationExample [Error message] [Debug log]
TestAccComputeImage_imageGuestOsExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 369 insertions(+), 143 deletions(-))
google-beta provider: Diff ( 8 files changed, 369 insertions(+), 143 deletions(-))
Open in Cloud Shell: Diff ( 3 files changed, 55 insertions(+), 10 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1036
Passed tests: 954
Skipped tests: 73
Affected tests: 9

Click here to see the affected service packages
  • compute

Action taken

Found 9 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeImageIamBindingGenerated
  • TestAccComputeImageIamBindingGenerated_withCondition
  • TestAccComputeImageIamMemberGenerated
  • TestAccComputeImageIamMemberGenerated_withCondition
  • TestAccComputeImageIamPolicyGenerated
  • TestAccComputeImageIamPolicyGenerated_withCondition
  • TestAccComputeImage_imageBasicExample
  • TestAccComputeImage_imageBasicStorageLocationExample
  • TestAccComputeImage_imageGuestOsExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeImageIamBindingGenerated [Debug log]
TestAccComputeImageIamBindingGenerated_withCondition [Debug log]
TestAccComputeImageIamMemberGenerated [Debug log]
TestAccComputeImageIamMemberGenerated_withCondition [Debug log]
TestAccComputeImageIamPolicyGenerated [Debug log]
TestAccComputeImageIamPolicyGenerated_withCondition [Debug log]
TestAccComputeImage_imageBasicExample [Debug log]
TestAccComputeImage_imageBasicStorageLocationExample [Debug log]
TestAccComputeImage_imageGuestOsExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

Copy link

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Contributor

@NickElliot NickElliot left a comment

Choose a reason for hiding this comment

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

changes LGTM! how long is the actual slowdown in the generated tests with deploying new disks?

@SirGitsalot
Copy link
Member Author

Looking at the logs, it's about 10 seconds at the start of the test to create the disk, and another 10 seconds at the end to delete it.

@SirGitsalot SirGitsalot merged commit cdd8585 into GoogleCloudPlatform:main Oct 24, 2024
12 of 13 checks passed
@SirGitsalot SirGitsalot deleted the issue-19885 branch October 24, 2024 20:50
wyardley added a commit to wyardley/magic-modules that referenced this pull request Oct 26, 2024
It seems like the fix in GoogleCloudPlatform#12062 may not have fixed the images relying on
Ubuntu images in the `tdx-guest-images` project.

Part of hashicorp/terraform-provider-google#19885
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
amanMahendroo pushed a commit to amanMahendroo/magic-modules that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants