Skip to content

Commit

Permalink
Fix hashicorp/terraform-provider-google#17388 (only run tests in beta) (
Browse files Browse the repository at this point in the history
  • Loading branch information
rainshen49 authored and Charles Leon committed Mar 11, 2024
1 parent 58b0fa3 commit e8f9c8c
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 7 deletions.
2 changes: 2 additions & 0 deletions mmv1/products/firebaseappcheck/AppAttestConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/firebaseappcheck/DebugToken.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/firebaseappcheck/PlayIntegrityConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/firebaseappcheck/RecaptchaV3Config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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'] %>"
Expand All @@ -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'] %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -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'] %>"
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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'] %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -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'] %>"
Expand All @@ -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'] %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -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'] %>"
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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'] %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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'] %>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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": {},
Expand Down Expand Up @@ -58,6 +58,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"
}
Expand All @@ -70,6 +72,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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,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": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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": {},
Expand Down

0 comments on commit e8f9c8c

Please sign in to comment.