From cd2649eeffe7e9f067a0ee54fb6a6a57cfea2d54 Mon Sep 17 00:00:00 2001 From: Lingkai Shen Date: Wed, 27 Mar 2024 14:32:53 -0400 Subject: [PATCH] Fix hashicorp/terraform-provider-google#17388 (only run tests in beta) (#10120) --- mmv1/products/firebaseappcheck/AppAttestConfig.yaml | 2 ++ mmv1/products/firebaseappcheck/DebugToken.yaml | 1 + mmv1/products/firebaseappcheck/PlayIntegrityConfig.yaml | 2 ++ .../firebaseappcheck/RecaptchaEnterpriseConfig.yaml | 1 + mmv1/products/firebaseappcheck/RecaptchaV3Config.yaml | 1 + .../firebase_app_check_app_attest_config_full.tf.erb | 4 ++++ .../firebase_app_check_app_attest_config_minimal.tf.erb | 4 ++++ .../examples/firebase_app_check_debug_token_basic.tf.erb | 8 ++++++-- .../firebase_app_check_play_integrity_config_full.tf.erb | 4 ++++ ...rebase_app_check_play_integrity_config_minimal.tf.erb | 4 ++++ ...se_app_check_recaptcha_enterprise_config_basic.tf.erb | 4 ++++ .../firebase_app_check_recaptcha_v3_config_basic.tf.erb | 4 ++++ ...rce_firebase_app_check_app_attest_config_test.go.erb} | 5 ++++- ... resource_firebase_app_check_debug_token_test.go.erb} | 9 ++++++++- ...firebase_app_check_play_integrity_config_test.go.erb} | 5 ++++- ...se_app_check_recaptcha_enterprise_config_test.go.erb} | 5 ++++- ...e_firebase_app_check_recaptcha_v3_config_test.go.erb} | 5 ++++- 17 files changed, 61 insertions(+), 7 deletions(-) rename mmv1/third_party/terraform/services/firebaseappcheck/{resource_firebase_app_check_app_attest_config_test.go => resource_firebase_app_check_app_attest_config_test.go.erb} (93%) rename mmv1/third_party/terraform/services/firebaseappcheck/{resource_firebase_app_check_debug_token_test.go => resource_firebase_app_check_debug_token_test.go.erb} (92%) rename mmv1/third_party/terraform/services/firebaseappcheck/{resource_firebase_app_check_play_integrity_config_test.go => resource_firebase_app_check_play_integrity_config_test.go.erb} (93%) rename mmv1/third_party/terraform/services/firebaseappcheck/{resource_firebase_app_check_recaptcha_enterprise_config_test.go => resource_firebase_app_check_recaptcha_enterprise_config_test.go.erb} (93%) rename mmv1/third_party/terraform/services/firebaseappcheck/{resource_firebase_app_check_recaptcha_v3_config_test.go => resource_firebase_app_check_recaptcha_v3_config_test.go.erb} (92%) diff --git a/mmv1/products/firebaseappcheck/AppAttestConfig.yaml b/mmv1/products/firebaseappcheck/AppAttestConfig.yaml index 9675f5c0bff1..070508cd67d0 100644 --- a/mmv1/products/firebaseappcheck/AppAttestConfig.yaml +++ b/mmv1/products/firebaseappcheck/AppAttestConfig.yaml @@ -37,6 +37,7 @@ import_format: examples: - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_app_attest_config_minimal" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" @@ -50,6 +51,7 @@ examples: project_id: :PROJECT_NAME - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_app_attest_config_full" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" diff --git a/mmv1/products/firebaseappcheck/DebugToken.yaml b/mmv1/products/firebaseappcheck/DebugToken.yaml index 4a6867760d36..e555a2ecd794 100644 --- a/mmv1/products/firebaseappcheck/DebugToken.yaml +++ b/mmv1/products/firebaseappcheck/DebugToken.yaml @@ -38,6 +38,7 @@ import_format: examples: - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_debug_token_basic" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" diff --git a/mmv1/products/firebaseappcheck/PlayIntegrityConfig.yaml b/mmv1/products/firebaseappcheck/PlayIntegrityConfig.yaml index 8794a0b0d3c8..76ebb37e9b3c 100644 --- a/mmv1/products/firebaseappcheck/PlayIntegrityConfig.yaml +++ b/mmv1/products/firebaseappcheck/PlayIntegrityConfig.yaml @@ -37,6 +37,7 @@ import_format: examples: - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_play_integrity_config_minimal" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" @@ -46,6 +47,7 @@ examples: project_id: :PROJECT_NAME - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_play_integrity_config_full" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" diff --git a/mmv1/products/firebaseappcheck/RecaptchaEnterpriseConfig.yaml b/mmv1/products/firebaseappcheck/RecaptchaEnterpriseConfig.yaml index a103c5dfb226..7d0dd0fb6b08 100644 --- a/mmv1/products/firebaseappcheck/RecaptchaEnterpriseConfig.yaml +++ b/mmv1/products/firebaseappcheck/RecaptchaEnterpriseConfig.yaml @@ -36,6 +36,7 @@ import_format: examples: - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_recaptcha_enterprise_config_basic" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" diff --git a/mmv1/products/firebaseappcheck/RecaptchaV3Config.yaml b/mmv1/products/firebaseappcheck/RecaptchaV3Config.yaml index 1e42c4796246..c259d076ee9e 100644 --- a/mmv1/products/firebaseappcheck/RecaptchaV3Config.yaml +++ b/mmv1/products/firebaseappcheck/RecaptchaV3Config.yaml @@ -36,6 +36,7 @@ import_format: examples: - !ruby/object:Provider::Terraform::Examples name: "firebase_app_check_recaptcha_v3_config_basic" + min_version: 'beta' # Need the time_sleep resource pull_external: true primary_resource_id: "default" diff --git a/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_full.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_full.tf.erb index 134ecacfc5f8..4ef023c54153 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_full.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_full.tf.erb @@ -1,4 +1,6 @@ resource "google_firebase_apple_app" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Apple app" bundle_id = "<%= ctx[:vars]['bundle_id'] %>" @@ -13,6 +15,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_app_attest_config" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_apple_app.default.app_id token_ttl = "<%= ctx[:vars]['token_ttl'] %>" diff --git a/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_minimal.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_minimal.tf.erb index a25a7f2d698f..4ecb2eb56a87 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_minimal.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_app_attest_config_minimal.tf.erb @@ -1,4 +1,6 @@ resource "google_firebase_apple_app" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Apple app" bundle_id = "<%= ctx[:vars]['bundle_id'] %>" @@ -13,6 +15,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_app_attest_config" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_apple_app.default.app_id diff --git a/mmv1/templates/terraform/examples/firebase_app_check_debug_token_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_debug_token_basic.tf.erb index 2434f163f5c0..4b27b397b226 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_debug_token_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_debug_token_basic.tf.erb @@ -1,16 +1,20 @@ resource "google_firebase_web_app" "default" { - project = "<%= ctx[:test_env_vars]['project_id'] %>" + provider = google-beta + + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Web App for debug token" } # It takes a while for App Check to recognize the new app # If your app already exists, you don't have to wait 30 seconds. resource "time_sleep" "wait_30s" { - depends_on = [google_firebase_web_app.default] + depends_on = [google_firebase_web_app.default] create_duration = "30s" } resource "google_firebase_app_check_debug_token" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_web_app.default.app_id display_name = "<%= ctx[:vars]['display_name'] %>" diff --git a/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_full.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_full.tf.erb index 78559763e319..5ec82cf383bb 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_full.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_full.tf.erb @@ -1,4 +1,6 @@ resource "google_firebase_android_app" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Play Integrity app" package_name = "<%= ctx[:vars]['package_name'] %>" @@ -14,6 +16,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_play_integrity_config" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_android_app.default.app_id token_ttl = "<%= ctx[:vars]['token_ttl'] %>" diff --git a/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_minimal.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_minimal.tf.erb index 4aacde367414..e360e1e07d08 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_minimal.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_play_integrity_config_minimal.tf.erb @@ -1,4 +1,6 @@ resource "google_firebase_android_app" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Play Integrity app" package_name = "<%= ctx[:vars]['package_name'] %>" @@ -14,6 +16,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_play_integrity_config" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_android_app.default.app_id diff --git a/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_enterprise_config_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_enterprise_config_basic.tf.erb index 806dfe37a16d..88435881cd40 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_enterprise_config_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_enterprise_config_basic.tf.erb @@ -1,4 +1,6 @@ resource "google_firebase_web_app" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Web App for reCAPTCHA Enterprise" } @@ -11,6 +13,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_recaptcha_enterprise_config" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_web_app.default.app_id site_key = "<%= ctx[:vars]['site_key'] %>" diff --git a/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_v3_config_basic.tf.erb b/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_v3_config_basic.tf.erb index 4b4c88b7ddd7..18b6a671ea72 100644 --- a/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_v3_config_basic.tf.erb +++ b/mmv1/templates/terraform/examples/firebase_app_check_recaptcha_v3_config_basic.tf.erb @@ -1,4 +1,6 @@ resource "google_firebase_web_app" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" display_name = "Web App for reCAPTCHA V3" } @@ -11,6 +13,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_recaptcha_v3_config" "default" { + provider = google-beta + project = "<%= ctx[:test_env_vars]['project_id'] %>" app_id = google_firebase_web_app.default.app_id site_secret = "<%= ctx[:vars]['site_secret'] %>" diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go.erb similarity index 93% rename from mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go rename to mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go.erb index a1b05b852feb..7efea05411fd 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go +++ b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_app_attest_config_test.go.erb @@ -1,4 +1,6 @@ +<% autogen_exception -%> package firebaseappcheck_test +<% unless version == 'ga' -%> import ( "testing" @@ -21,7 +23,7 @@ func TestAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigUpdat acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -57,3 +59,4 @@ func TestAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigUpdat }, }) } +<% end -%> diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go.erb similarity index 92% rename from mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go rename to mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go.erb index e0e205580be9..be5bad79fcb4 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go +++ b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_debug_token_test.go.erb @@ -1,4 +1,6 @@ +<% autogen_exception -%> package firebaseappcheck_test +<% unless version == 'ga' -%> import ( "testing" @@ -26,7 +28,7 @@ func TestAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenUpdate(t *testi acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -58,6 +60,8 @@ func TestAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenUpdate(t *testi func testAccFirebaseAppCheckDebugToken_firebaseAppCheckDebugTokenTemplate(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_firebase_web_app" "default" { + provider = google-beta + project = "%{project_id}" display_name = "Web App for debug token" } @@ -70,6 +74,8 @@ resource "time_sleep" "wait_30s" { } resource "google_firebase_app_check_debug_token" "default" { + provider = google-beta + project = "%{project_id}" app_id = google_firebase_web_app.default.app_id display_name = "%{display_name}" @@ -79,3 +85,4 @@ resource "google_firebase_app_check_debug_token" "default" { } `, context) } +<% end -%> diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go.erb similarity index 93% rename from mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go rename to mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go.erb index c97df9fd1fab..93bebec70a3c 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go +++ b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_play_integrity_config_test.go.erb @@ -1,4 +1,6 @@ +<% autogen_exception -%> package firebaseappcheck_test +<% unless version == 'ga' -%> import ( "testing" @@ -20,7 +22,7 @@ func TestAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityCon acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -56,3 +58,4 @@ func TestAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityCon }, }) } +<% end -%> diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go.erb similarity index 93% rename from mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go rename to mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go.erb index 6d0a91601ea7..9fb1a6f11d28 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go +++ b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_enterprise_config_test.go.erb @@ -1,4 +1,6 @@ +<% autogen_exception -%> package firebaseappcheck_test +<% unless version == 'ga' -%> import ( "testing" @@ -28,7 +30,7 @@ func TestAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaE acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -55,3 +57,4 @@ func TestAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaE }, }) } +<% end -%> diff --git a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go.erb similarity index 92% rename from mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go rename to mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go.erb index 961215b8f63e..28829e711622 100644 --- a/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go +++ b/mmv1/third_party/terraform/services/firebaseappcheck/resource_firebase_app_check_recaptcha_v3_config_test.go.erb @@ -1,4 +1,6 @@ +<% autogen_exception -%> package firebaseappcheck_test +<% unless version == 'ga' -%> import ( "testing" @@ -28,7 +30,7 @@ func TestAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigU acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), ExternalProviders: map[string]resource.ExternalProvider{ "random": {}, "time": {}, @@ -55,3 +57,4 @@ func TestAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigU }, }) } +<% end -%>