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 BBBmau committed Mar 27, 2024
1 parent bf6c514 commit cd2649e
Show file tree
Hide file tree
Showing 17 changed files with 61 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
@@ -1,4 +1,6 @@
<% autogen_exception -%>
package firebaseappcheck_test
<% unless version == 'ga' -%>

import (
"testing"
Expand All @@ -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": {},
Expand Down Expand Up @@ -57,3 +59,4 @@ func TestAccFirebaseAppCheckAppAttestConfig_firebaseAppCheckAppAttestConfigUpdat
},
})
}
<% end -%>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% autogen_exception -%>
package firebaseappcheck_test
<% unless version == 'ga' -%>

import (
"testing"
Expand Down Expand Up @@ -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": {},
Expand Down Expand Up @@ -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"
}
Expand All @@ -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}"
Expand All @@ -79,3 +85,4 @@ resource "google_firebase_app_check_debug_token" "default" {
}
`, context)
}
<% end -%>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% autogen_exception -%>
package firebaseappcheck_test
<% unless version == 'ga' -%>

import (
"testing"
Expand All @@ -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": {},
Expand Down Expand Up @@ -56,3 +58,4 @@ func TestAccFirebaseAppCheckPlayIntegrityConfig_firebaseAppCheckPlayIntegrityCon
},
})
}
<% end -%>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% autogen_exception -%>
package firebaseappcheck_test
<% unless version == 'ga' -%>

import (
"testing"
Expand Down Expand Up @@ -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": {},
Expand All @@ -55,3 +57,4 @@ func TestAccFirebaseAppCheckRecaptchaEnterpriseConfig_firebaseAppCheckRecaptchaE
},
})
}
<% end -%>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% autogen_exception -%>
package firebaseappcheck_test
<% unless version == 'ga' -%>

import (
"testing"
Expand Down Expand Up @@ -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": {},
Expand All @@ -55,3 +57,4 @@ func TestAccFirebaseAppCheckRecaptchaV3Config_firebaseAppCheckRecaptchaV3ConfigU
},
})
}
<% end -%>

0 comments on commit cd2649e

Please sign in to comment.