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 endpointAttachment in Apigee #5717

Merged
merged 28 commits into from
Feb 23, 2022
Merged

Conversation

xuchenma
Copy link
Contributor

@xuchenma xuchenma commented Feb 16, 2022

This PR adds a new resource EndpointAttachment in Apigee (hashicorp/terraform-provider-google#11118)

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_apigee_endpoint_attachment`

xuchenma and others added 25 commits October 3, 2021 07:17
Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
@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.

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

@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 ( 5 files changed, 645 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 645 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))

@xuchenma
Copy link
Contributor Author

I ran the Terraform test case locally, and it was able to CREATE, GET, DELETE this resource. However the test returns this error:

=== RUN   TestAccApigeeEndpointAttachment_apigeeEndpointAttachmentBasicTestExample
=== PAUSE TestAccApigeeEndpointAttachment_apigeeEndpointAttachmentBasicTestExample
=== CONT  TestAccApigeeEndpointAttachment_apigeeEndpointAttachmentBasicTestExample
    provider_test.go:278: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) (len=4) {
         (string) (len=4) "host": (string) "",
         (string) (len=8) "location": (string) "",
         (string) (len=4) "name": (string) "",
         (string) (len=18) "service_attachment": (string) ""
        }
        
        
        (map[string]string) (len=4) {
         (string) (len=4) "host": (string) (len=7) "7.0.0.2",
         (string) (len=8) "location": (string) (len=8) "us-west2",
         (string) (len=4) "name": (string) (len=56) "organizations/apigee-tf-test-2/endpointAttachments/test1",
         (string) (len=18) "service_attachment": (string) (len=72) "projects/apigee-tf-test-2/regions/us-west2/serviceAttachments/my-psc-ilb"
        }
--- FAIL: TestAccApigeeEndpointAttachment_apigeeEndpointAttachmentBasicTestExample (645.56s)

I'm not sure what might go wrong here.

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

I am still working on reproducing your issue, but running into difficulties with rate limiting in our testing environment.
While that is pending, I can immediately identify an issue: the resource names in your example file will need to be wrapped in ruby tags and referenced in the terraform.yaml.
This is for multiple reasons, but the primary one being so that we can append a random suffix to resource names to avoid collisions while testing our entire suite.

@xuchenma
Copy link
Contributor Author

That might not be needed for Apigee resources, because for Apigee, each test creates its own GCP project, run the test, and delete the project. So collisions won't happen. I see tests for other Apigee resources are all written this way (no ruby tags).

@xuchenma
Copy link
Contributor Author

I updated mmv1/templates/terraform/custom_import/apigee_endpoint_attachment.go.erb and it fixed the ImportStateVerify error; the tests are passing now.

@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 ( 5 files changed, 660 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 660 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))

@c2thorn
Copy link
Member

c2thorn commented Feb 22, 2022

/gcbrun

@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 ( 5 files changed, 660 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 660 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests were added that did not run in TeamCity:

  • TestAccApigeeEndpointAttachment_apigeeEndpointAttachmentBasicTestExample

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccApigeeEnvironmentIamMemberGenerated|TestAccApigeeEnvironmentIamPolicyGenerated|TestAccCloudbuildWorkerPool_basic|TestAccComputeInstanceTemplate_reservationAffinities|TestAccContainerCluster_withAuthenticatorGroupsConfig You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=260291

@c2thorn
Copy link
Member

c2thorn commented Feb 22, 2022

VCR test passed from what is available, but apparently we need to skip VCR for the main test. Running the primary example test directly in our testing environment

@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 ( 5 files changed, 678 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 678 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

Implementation LGTM, noting we still need to have a passing test, which is running now.

@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 ( 5 files changed, 681 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 681 insertions(+), 2 deletions(-))
TF Validator: Diff ( 3 files changed, 76 insertions(+), 3 deletions(-))

@c2thorn
Copy link
Member

c2thorn commented Feb 23, 2022

manual test succeeded!

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.

3 participants