Documentation ¶
Index ¶
- Constants
- Variables
- func FindDefaultServiceAccount() (string, error)
- func GetCloudFunctionsTestProject(_ *testing.T) string
- func GetDLPTestBucket(_ *testing.T) string
- func GetDefaultProjectID(t *testing.T) string
- func GetDependentFolder2ProjectID(_ *testing.T) string
- func GetDependentFolderProjectID(_ *testing.T) string
- func GetHighCPUQuotaTestProject(_ *testing.T) string
- func GetIAMPolicyBindingMember(t *testing.T) string
- func GetInterconnectTestProject(_ *testing.T) string
- func GetIsolatedTestOrgName(_ *testing.T) string
- func GetProjectNumber(ctx context.Context, projectID string) (int64, error)
- func NewDefaultHTTPClient(t *testing.T) *http.Client
- func NewIAMClient(t *testing.T) *iam.Service
- func NewResourceManagerClient(t *testing.T) *cloudresourcemanager.Service
- func NewStorageClient(t *testing.T) *storage.Service
- func ResourceSupportsDeletion(resourceKind string) bool
- type EnvVar
- type GCPProject
Constants ¶
View Source
const ( TestDependentFolder2ProjectID = "TEST_DEPENDENT_FOLDER_2_PROJECT_ID" TestDependentFolderProjectID = "TEST_DEPENDENT_FOLDER_PROJECT_ID" IsolatedTestOrgName = "ISOLATED_TEST_ORG_NAME" CloudFunctionsTestProject = "CLOUD_FUNCTIONS_TEST_PROJECT" InterconnectTestProject = "INTERCONNECT_TEST_PROJECT" HighCPUQuotaTestProject = "HIGH_CPU_QUOTA_TEST_PROJECT" DLPTestBucket = "DLP_TEST_BUCKET" )
Variables ¶
View Source
var ( TestFolderID = EnvVar{Key: "TEST_FOLDER_ID"} TestFolder2ID = EnvVar{Key: "TEST_FOLDER_2_ID"} TestOrgID = EnvVar{Key: "TEST_ORG_ID"} TestDependentOrgProjectID = EnvVar{Key: "TEST_DEPENDENT_ORG_PROJECT_ID"} TestBillingAccountID = EnvVar{Key: "TEST_BILLING_ACCOUNT_ID"} IAMIntegrationTestsOrganizationID = EnvVar{Key: "IAM_INTEGRATION_TESTS_ORGANIZATION_ID"} IAMIntegrationTestsBillingAccountID = EnvVar{Key: "IAM_INTEGRATION_TESTS_BILLING_ACCOUNT_ID"} TestBillingAccountIDForBillingResources = EnvVar{Key: "BILLING_ACCOUNT_ID_FOR_BILLING_RESOURCES"} TestAttachedClusterName = EnvVar{Key: "TEST_ATTACHED_CLUSTER_NAME"} TestKCCAttachedClusterProject = EnvVar{Key: "KCC_ATTACHED_CLUSTER_TEST_PROJECT"} FirestoreTestProject = EnvVar{Key: "FIRESTORE_TEST_PROJECT"} IdentityPlatformTestProject = EnvVar{Key: "IDENTITY_PLATFORM_TEST_PROJECT"} RecaptchaEnterpriseTestProject = EnvVar{Key: "RECAPTCHA_ENTERPRISE_TEST_PROJECT"} TestDependentNoNetworkProjectID = EnvVar{Key: "TEST_DEPENDENT_NO_NETWORK_PROJECT_ID"} // A dependent project with default network disabled TestKCCVertexAIIndexBucket = EnvVar{Key: "KCC_VERTEX_AI_INDEX_TEST_BUCKET"} TestKCCVertexAIIndexDataURI = EnvVar{Key: "KCC_VERTEX_AI_INDEX_TEST_DATA_URI"} )
Functions ¶
func FindDefaultServiceAccount ¶ added in v1.101.0
FindDefaultServiceAccount returns the service account used to access the user's configured default GCP project. If the credentials cannot be found, returns ("", nil)
func GetDLPTestBucket ¶ added in v1.97.0
func GetDefaultProjectID ¶
GetDefaultProjectID returns the ID of user's configured default GCP project.
func GetDependentFolder2ProjectID ¶ added in v1.114.0
func GetDependentFolderProjectID ¶ added in v1.106.0
func GetHighCPUQuotaTestProject ¶ added in v1.114.0
func GetIAMPolicyBindingMember ¶
attempts to return a valid IAM policy binding for the current credential by searching for an email in the cloud credentials file and defaulting to the current user if on a corp machine.
func GetIsolatedTestOrgName ¶
func GetProjectNumber ¶ added in v1.100.0
func NewIAMClient ¶
func NewStorageClient ¶
Types ¶
type EnvVar ¶ added in v1.112.0
type EnvVar struct { Key string // contains filtered or unexported fields }
EnvVar is a wrapper around a value that can be set by an environment variable. This approach allows the value to be changed in tests more easily.
type GCPProject ¶ added in v1.100.0
func GetDefaultProject ¶ added in v1.100.0
func GetDefaultProject(t *testing.T) GCPProject
GetDefaultProject returns the ID of user's configured default GCP project.
Click to show internal directories.
Click to hide internal directories.