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 Network and Subnet resources for edgenetwork #8905

Merged
merged 5 commits into from
Sep 18, 2023

Conversation

f1urps
Copy link
Contributor

@f1urps f1urps commented Sep 9, 2023

This PR adds two new resources, Network and Subnet, under a new product edgenetwork.

Fixes this issue: hashicorp/terraform-provider-google#15664

Release Note Template for Downstream PRs (will be copied)

edgenetwork : `google_edgenetwork_network`
edgenetwork : `google_edgenetwork_subnet`

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will require approval to run.

@zli82016, 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 modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 9, 2023
@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Sep 11, 2023
@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.

Terraform GA: Diff ( 16 files changed, 1910 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 16 files changed, 1910 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 2 files changed, 227 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_edgenetwork_network (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_edgenetwork_network" "primary" {
  labels = # value needed
}

Resource: google_edgenetwork_subnet (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_edgenetwork_subnet" "primary" {
  labels = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3029
Passed tests 2729
Skipped tests: 297
Affected tests: 3

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccEdgenetworkSubnet_edgenetworkSubnetWithVlanIdExample|TestAccEdgenetworkSubnet_edgenetworkSubnetExample|TestAccEdgenetworkNetwork_edgenetworkNetworkExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccEdgenetworkSubnet_edgenetworkSubnetWithVlanIdExample[Error message] [Debug log]
TestAccEdgenetworkSubnet_edgenetworkSubnetExample[Error message] [Debug log]
TestAccEdgenetworkNetwork_edgenetworkNetworkExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@zli82016
Copy link
Member

/gcbrun

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 11, 2023
@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.

Terraform GA: Diff ( 16 files changed, 1910 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 16 files changed, 1910 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 2 files changed, 227 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_edgenetwork_network (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_edgenetwork_network" "primary" {
  labels = # value needed
}

Resource: google_edgenetwork_subnet (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_edgenetwork_subnet" "primary" {
  labels = # value needed
}

@zli82016
Copy link
Member

Can you please add the labels field to the tests? Please check the missing test report for details.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3038
Passed tests 2737
Skipped tests: 297
Affected tests: 4

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccEdgenetworkSubnet_edgenetworkSubnetWithVlanIdExample|TestAccEdgenetworkNetwork_edgenetworkNetworkExample|TestAccEdgenetworkSubnet_edgenetworkSubnetExample|TestAccHealthcareDatasetIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccHealthcareDatasetIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccEdgenetworkSubnet_edgenetworkSubnetWithVlanIdExample[Error message] [Debug log]
TestAccEdgenetworkNetwork_edgenetworkNetworkExample[Error message] [Debug log]
TestAccEdgenetworkSubnet_edgenetworkSubnetExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@zli82016
Copy link
Member

Can you also fix the failed tests? Thanks.

@f1urps
Copy link
Contributor Author

f1urps commented Sep 12, 2023

Can you also fix the failed tests? Thanks.

These tests are failing because they don't have a valid GDCE zone to operate on. Unfortunately the edgenetwork API does not support the creation of a zone without an actual hardware deployment. Can we skip these tests?

@zli82016
Copy link
Member

Is there a doc how to create a zone with an actual hardware deployment? Thanks.

@f1urps
Copy link
Contributor Author

f1urps commented Sep 13, 2023

Is there a doc how to create a zone with an actual hardware deployment? Thanks.

Internally in GDCE we have several zones created for testing/development purposes, which I can use to run these acceptance tests. However I'm not sure it's a good idea to expose the details for them in a public GitHub repo. Alternatively, a GDCE zone can be purchased and provisioned via these steps.

Currently it is not possible to run any kind of E2E test for the edgenetwork API without owning some GDCE hardware, either provided by Google internally or purchased as a customer. To me, neither of these options seem to make sense for an open-source project.

I can confirm these tests are passing when I run them on a test zone. Would it be okay to disable these tests in the CI, and leave them as manual-run only?

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 13, 2023
@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.

Terraform GA: Diff ( 16 files changed, 1928 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 16 files changed, 1928 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 2 files changed, 227 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3040
Passed tests 2732
Skipped tests: 297
Affected tests: 11

Action taken

Found 11 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccEdgenetworkNetwork_edgenetworkNetworkExample|TestAccEdgenetworkSubnet_edgenetworkSubnetWithVlanIdExample|TestAccEdgenetworkSubnet_edgenetworkSubnetExample|TestAccMonitoringMonitoredProject_monitoringMonitoredProjectLongFormExample|TestAccMonitoringMonitoredProject_projectNumLongForm|TestAccMonitoringMonitoredProject_projectNumShortForm|TestAccMonitoringMonitoredProject_monitoringMonitoredProjectBasicExample|TestAccSpannerDatabaseIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample[Debug log]
TestAccMonitoringMonitoredProject_monitoringMonitoredProjectLongFormExample[Debug log]
TestAccMonitoringMonitoredProject_projectNumLongForm[Debug log]
TestAccMonitoringMonitoredProject_projectNumShortForm[Debug log]
TestAccMonitoringMonitoredProject_monitoringMonitoredProjectBasicExample[Debug log]
TestAccSpannerDatabaseIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccEdgenetworkNetwork_edgenetworkNetworkExample[Error message] [Debug log]
TestAccEdgenetworkSubnet_edgenetworkSubnetWithVlanIdExample[Error message] [Debug log]
TestAccEdgenetworkSubnet_edgenetworkSubnetExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@zli82016
Copy link
Member

Is there a doc how to create a zone with an actual hardware deployment? Thanks.

Internally in GDCE we have several zones created for testing/development purposes, which I can use to run these acceptance tests. However I'm not sure it's a good idea to expose the details for them in a public GitHub repo. Alternatively, a GDCE zone can be purchased and provisioned via these steps.

Currently it is not possible to run any kind of E2E test for the edgenetwork API without owning some GDCE hardware, either provided by Google internally or purchased as a customer. To me, neither of these options seem to make sense for an open-source project.

I can confirm these tests are passing when I run them on a test zone. Would it be okay to disable these tests in the CI, and leave them as manual-run only?

You can remove these tests by adding skip_test: true. Example:

There is no way to leave them as manual-run only.

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Sep 18, 2023
@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.

Terraform GA: Diff ( 14 files changed, 1639 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 14 files changed, 1639 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 2 files changed, 227 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_edgenetwork_network (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_edgenetwork_network" "primary" {
  description = # value needed
  labels      = # value needed
  location    = # value needed
  mtu         = # value needed
  network_id  = # value needed
  zone        = # value needed
}

Resource: google_edgenetwork_subnet (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_edgenetwork_subnet" "primary" {
  description = # value needed
  ipv4_cidr   = # value needed
  ipv6_cidr   = # value needed
  labels      = # value needed
  location    = # value needed
  network     = # value needed
  subnet_id   = # value needed
  vlan_id     = # value needed
  zone        = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3068
Passed tests 2769
Skipped tests: 299
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@zli82016
Copy link
Member

LGTM. Thanks.

@zli82016 zli82016 merged commit 960ba10 into GoogleCloudPlatform:main Sep 18, 2023
8 checks passed
nevzheng pushed a commit to nevzheng/magic-modules that referenced this pull request Sep 22, 2023
…#8905)

* Add Network and Subnet resources for edgenetwork

* Fix lint

* Added labels field to acceptance tests; Removed send_empty_value:false from vlan_id field in Subnet

* Skip edgenetwork acceptance tests
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