Skip to content

Commit

Permalink
Fix flaky apigee tests (GoogleCloudPlatform#12387)
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 authored Nov 26, 2024
1 parent 496c104 commit c2554dc
Show file tree
Hide file tree
Showing 25 changed files with 169 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mmv1/products/apigee/Developer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ examples:
billing_account: "BILLING_ACCT"
exclude_docs: true
skip_vcr: true
external_providers: ["time"]
- name: "apigee_developer_with_attributes"
vars:
instance_name: "my-instance"
Expand All @@ -56,6 +57,7 @@ examples:
billing_account: "BILLING_ACCT"
exclude_docs: true
skip_vcr: true
external_providers: ["time"]
parameters:
- name: "orgId"
type: String
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/apigee/EnvKeystore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ examples:
org_id: 'ORG_ID'
billing_account: 'BILLING_ACCT'
exclude_docs: true
external_providers: ["time"]
parameters:
- name: 'envId'
type: String
Expand Down
3 changes: 3 additions & 0 deletions mmv1/products/apigee/Environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_environment_basic_deployment_apiproxy_type_test'
primary_resource_id: 'apigee_environment'
primary_resource_name: 'fmt.Sprintf("organizations/tf-test%s", context["random_suffix"]), fmt.Sprintf("tf-test%s", context["random_suffix"])'
Expand All @@ -83,6 +84,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_environment_patch_update_test'
primary_resource_id: 'apigee_environment'
primary_resource_name: 'fmt.Sprintf("organizations/tf-test%s", context["random_suffix"]), fmt.Sprintf("tf-test%s", context["random_suffix"])'
Expand All @@ -93,6 +95,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
parameters:
- name: 'orgId'
type: String
Expand Down
5 changes: 5 additions & 0 deletions mmv1/products/apigee/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_instance_cidr_range'
vars:
instance_name: 'my-instance-name'
Expand All @@ -83,6 +84,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_instance_ip_range'
vars:
instance_name: 'my-instance-name'
Expand All @@ -97,6 +99,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_instance_full'
vars:
instance_name: 'my-instance-name'
Expand All @@ -112,6 +115,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_instance_service_attachment_basic_test'
primary_resource_id: 'apigee_instance'
test_env_vars:
Expand All @@ -120,6 +124,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
parameters:
- name: 'orgId'
type: String
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/apigee/InstanceAttachment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
parameters:
- name: 'instanceId'
type: String
Expand Down
5 changes: 5 additions & 0 deletions mmv1/products/apigee/Organization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_organization_cloud_basic_disable_vpc_peering'
exclude_test: true
# This is a more verbose version of the above that creates all
Expand Down Expand Up @@ -95,6 +96,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_organization_cloud_full_disable_vpc_peering'
exclude_test: true
# This is a more verbose version of the above that creates all
Expand All @@ -112,6 +114,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_organization_retention_test'
primary_resource_id: 'org'
min_version: 'beta'
Expand All @@ -121,6 +124,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
- name: 'apigee_organization_drz_test'
primary_resource_id: 'org'
min_version: 'beta'
Expand All @@ -130,6 +134,7 @@ examples:
exclude_docs: true
# Resource creation race
skip_vcr: true
external_providers: ["time"]
parameters:
- name: 'projectId'
type: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "compute" {
project = google_project.project.project_id
service = "compute.googleapis.com"
depends_on = [google_project_service.apigee]
}

resource "google_project_service" "servicenetworking" {
project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
depends_on = [google_project_service.compute]
}

resource "google_compute_network" "apigee_network" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "servicenetworking" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "servicenetworking" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "servicenetworking" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,41 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
provider = google-beta

project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "compute" {
provider = google-beta

project = google_project.project.project_id
service = "compute.googleapis.com"
depends_on = [google_project_service.apigee]
}

resource "google_project_service" "servicenetworking" {
provider = google-beta

project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
depends_on = [google_project_service.compute]
}

resource "google_project_service" "kms" {
provider = google-beta

project = google_project.project.project_id
service = "cloudkms.googleapis.com"
depends_on = [google_project_service.servicenetworking]
}

resource "google_compute_network" "apigee_network" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "compute" {
project = google_project.project.project_id
service = "compute.googleapis.com"
depends_on = [google_project_service.apigee]
}

resource "google_project_service" "servicenetworking" {
project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
depends_on = [google_project_service.compute]
}

resource "google_compute_network" "apigee_network" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "compute" {
project = google_project.project.project_id
service = "compute.googleapis.com"
depends_on = [google_project_service.apigee]
}

resource "google_project_service" "servicenetworking" {
project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
depends_on = [google_project_service.compute]
}

resource "google_compute_network" "apigee_network" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "compute" {
project = google_project.project.project_id
service = "compute.googleapis.com"
depends_on = [google_project_service.apigee]
}

resource "google_project_service" "servicenetworking" {
project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
depends_on = [google_project_service.compute]
}

resource "google_compute_network" "apigee_network" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,41 @@ resource "google_project" "project" {
deletion_policy = "DELETE"
}

resource "time_sleep" "wait_60_seconds" {
create_duration = "60s"
depends_on = [google_project.project]
}

resource "google_project_service" "apigee" {
provider = google-beta

project = google_project.project.project_id
service = "apigee.googleapis.com"
depends_on = [time_sleep.wait_60_seconds]
}

resource "google_project_service" "compute" {
provider = google-beta

project = google_project.project.project_id
service = "compute.googleapis.com"
depends_on = [google_project_service.apigee]
}

resource "google_project_service" "servicenetworking" {
provider = google-beta

project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
depends_on = [google_project_service.compute]
}

resource "google_project_service" "kms" {
provider = google-beta

project = google_project.project.project_id
service = "cloudkms.googleapis.com"
depends_on = [google_project_service.servicenetworking]
}

resource "google_compute_network" "apigee_network" {
Expand Down
Loading

0 comments on commit c2554dc

Please sign in to comment.