Documentation ¶
Overview ¶
Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: MPL-2.0
Index ¶
- Constants
- Variables
- func GetTestBillingAccountFromEnv(t *testing.T) string
- func GetTestCredsFromEnv() string
- func GetTestCustIdFromEnv(t *testing.T) string
- func GetTestFirestoreProjectFromEnv(t *testing.T) string
- func GetTestIdentityUserFromEnv(t *testing.T) string
- func GetTestMasterBillingAccountFromEnv(t *testing.T) string
- func GetTestOrgDomainFromEnv(t *testing.T) string
- func GetTestOrgFromEnv(t *testing.T) string
- func GetTestOrgTargetFromEnv(t *testing.T) string
- func GetTestProjectFromEnv() string
- func GetTestProjectNumberFromEnv() string
- func GetTestPublicAdvertisedPrefixDescriptionFromEnv(t *testing.T) string
- func GetTestRegionFromEnv() string
- func GetTestServiceAccountFromEnv(t *testing.T) string
- func GetTestZoneFromEnv() string
- func ServiceAccountCanonicalEmail(account string) string
- func SkipIfEnvNotSet(t *testing.T, envs ...string)
- func UnsafeGetTestOrgFromEnv() string
Constants ¶
const TestEnvVar = "TF_ACC"
Variables ¶
var BillingAccountEnvVars = []string{
"GOOGLE_BILLING_ACCOUNT",
}
This is the billing account that will be charged for the infrastructure used during testing. For that reason, it is also the billing account used for creating new projects.
var CredsEnvVars = []string{
"GOOGLE_CREDENTIALS",
"GOOGLE_CLOUD_KEYFILE_JSON",
"GCLOUD_KEYFILE_JSON",
"GOOGLE_APPLICATION_CREDENTIALS",
"GOOGLE_USE_DEFAULT_CREDENTIALS",
}
var CustIdEnvVars = []string{
"GOOGLE_CUST_ID",
}
This value is the Customer ID of the GOOGLE_ORG_DOMAIN workspace. See https://admin.google.com/ac/accountsettings when logged into an org admin for the value.
var FirestoreProjectEnvVars = []string{
"GOOGLE_FIRESTORE_PROJECT",
}
var IdentityUserEnvVars = []string{
"GOOGLE_IDENTITY_USER",
}
This value is the username of an identity account within the GOOGLE_ORG_DOMAIN workspace. For example in the org example.com with a user "foo@example.com", this would be set to "foo". See https://admin.google.com/ac/users when logged into an org admin for a list.
var MasterBillingAccountEnvVars = []string{
"GOOGLE_MASTER_BILLING_ACCOUNT",
}
This is the billing account that will be modified to test billing-related functionality. It is expected to have more permissions granted to the test user and support subaccounts.
var OrgEnvDomainVars = []string{
"GOOGLE_ORG_DOMAIN",
}
var OrgEnvVars = []string{
"GOOGLE_ORG",
}
var OrgTargetEnvVars = []string{
"GOOGLE_ORG_2",
}
var PapDescriptionEnvVars = []string{
"GOOGLE_PUBLIC_AVERTISED_PREFIX_DESCRIPTION",
}
This value is the description used for test PublicAdvertisedPrefix setup to avoid required DNS setup. This is only used during integration tests and would be invalid to surface to users
var ProjectEnvVars = []string{
"GOOGLE_PROJECT",
"GCLOUD_PROJECT",
"CLOUDSDK_CORE_PROJECT",
}
var ProjectNumberEnvVars = []string{
"GOOGLE_PROJECT_NUMBER",
}
var RegionEnvVars = []string{
"GOOGLE_REGION",
"GCLOUD_REGION",
"CLOUDSDK_COMPUTE_REGION",
}
var ServiceAccountEnvVars = []string{
"GOOGLE_SERVICE_ACCOUNT",
}
var ZoneEnvVars = []string{
"GOOGLE_ZONE",
"GCLOUD_ZONE",
"CLOUDSDK_COMPUTE_ZONE",
}
Functions ¶
func GetTestBillingAccountFromEnv ¶
This is the billing account that will be charged for the infrastructure used during testing. For that reason, it is also the billing account used for creating new projects.
func GetTestCredsFromEnv ¶
func GetTestCredsFromEnv() string
AccTestPreCheck ensures at least one of the credentials env variables is set.
func GetTestCustIdFromEnv ¶
func GetTestFirestoreProjectFromEnv ¶
Firestore can't be enabled at the same time as Datastore, so we need a new project to manage it until we can enable Firestore programmatically.
func GetTestMasterBillingAccountFromEnv ¶
This is the billing account that will be modified to test billing-related functionality. It is expected to have more permissions granted to the test user and support subaccounts.
func GetTestOrgDomainFromEnv ¶
func GetTestOrgFromEnv ¶
Returns the raw organization id like 1234567890, skipping the test if one is not found.
func GetTestOrgTargetFromEnv ¶
func GetTestProjectFromEnv ¶
func GetTestProjectFromEnv() string
AccTestPreCheck ensures at least one of the project env variables is set.
func GetTestProjectNumberFromEnv ¶
func GetTestProjectNumberFromEnv() string
AccTestPreCheck ensures at least one of the project env variables is set.
func GetTestRegionFromEnv ¶
func GetTestRegionFromEnv() string
AccTestPreCheck ensures at least one of the region env variables is set.
func GetTestZoneFromEnv ¶
func GetTestZoneFromEnv() string
func SkipIfEnvNotSet ¶
func UnsafeGetTestOrgFromEnv ¶
func UnsafeGetTestOrgFromEnv() string
Alternative to GetTestOrgFromEnv that doesn't need *testing.T If using this, you need to process unset values at the call site
Types ¶
This section is empty.