testgcp

package
v1.106.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestFolderId                            = "TEST_FOLDER_ID"
	TestFolder2Id                           = "TEST_FOLDER_2_ID"
	TestOrgId                               = "TEST_ORG_ID"
	TestDependentOrgProjectId               = "TEST_DEPENDENT_ORG_PROJECT_ID"
	TestDependentFolderProjectId            = "TEST_DEPENDENT_FOLDER_PROJECT_ID"
	TestDependentNoNetworkProjectId         = "TEST_DEPENDENT_NO_NETWORK_PROJECT_ID" // A dependent project with default network disabled
	IAMIntegrationTestsOrganizationId       = "IAM_INTEGRATION_TESTS_ORGANIZATION_ID"
	IsolatedTestOrgName                     = "ISOLATED_TEST_ORG_NAME"
	TestBillingAccountId                    = "TEST_BILLING_ACCOUNT_ID"
	TestBillingAccountIDForBillingResources = "BILLING_ACCOUNT_ID_FOR_BILLING_RESOURCES"
	IAMIntegrationTestsBillingAccountId     = "IAM_INTEGRATION_TESTS_BILLING_ACCOUNT_ID"
	FirestoreTestProject                    = "FIRESTORE_TEST_PROJECT"
	CloudFunctionsTestProject               = "CLOUD_FUNCTIONS_TEST_PROJECT"
	IdentityPlatformTestProject             = "IDENTITY_PLATFORM_TEST_PROJECT"
	InterconnectTestProject                 = "INTERCONNECT_TEST_PROJECT"
	HighCPUQuotaTestProject                 = "HIGH_CPU_QUOTA_TEST_PROJECT"
	RecaptchaEnterpriseTestProject          = "RECAPTCHA_ENTERPRISE_TEST_PROJECT"
	DLPTestBucket                           = "DLP_TEST_BUCKET"
)

Variables

This section is empty.

Functions

func FindDefaultServiceAccount added in v1.101.0

func FindDefaultServiceAccount() (string, error)

FindDefaultServiceAccount returns the service account used to access the user's configured default GCP project. If the credentials cannot be found, returns ("", nil)

func GetBillingAccountID

func GetBillingAccountID(t *testing.T) string

func GetCloudFunctionsTestProject

func GetCloudFunctionsTestProject(t *testing.T) string

func GetDLPTestBucket added in v1.97.0

func GetDLPTestBucket(t *testing.T) string

func GetDefaultProjectID

func GetDefaultProjectID(t *testing.T) string

GetDefaultProjectID returns the ID of user's configured default GCP project.

func GetDependentFolderProjectID added in v1.106.0

func GetDependentFolderProjectID(t *testing.T) string

func GetDependentNoNetworkProjectID added in v1.106.0

func GetDependentNoNetworkProjectID(t *testing.T) string

func GetDependentOrgProjectID added in v1.106.0

func GetDependentOrgProjectID(t *testing.T) string

func GetFirestoreTestProject

func GetFirestoreTestProject(t *testing.T) string

func GetFolder2ID

func GetFolder2ID(t *testing.T) string

func GetFolderID

func GetFolderID(t *testing.T) string

func GetHighCpuQuotaTestProject

func GetHighCpuQuotaTestProject(t *testing.T) string

func GetIAMIntegrationTestsBillingAccountId

func GetIAMIntegrationTestsBillingAccountId(t *testing.T) string

func GetIAMIntegrationTestsOrganizationId

func GetIAMIntegrationTestsOrganizationId(t *testing.T) string

func GetIAMPolicyBindingMember

func GetIAMPolicyBindingMember(t *testing.T) string

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 GetIdentityPlatformTestProject

func GetIdentityPlatformTestProject(t *testing.T) string

func GetInterconnectTestProject

func GetInterconnectTestProject(t *testing.T) string

func GetIsolatedTestOrgName

func GetIsolatedTestOrgName(t *testing.T) string

func GetOrgID

func GetOrgID(t *testing.T) string

func GetProjectNumber added in v1.100.0

func GetProjectNumber(ctx context.Context, projectID string) (int64, error)

func GetRecaptchaEnterpriseTestProject

func GetRecaptchaEnterpriseTestProject(t *testing.T) string

func GetTestBillingAccountIDForBillingResources

func GetTestBillingAccountIDForBillingResources(t *testing.T) string

func NewDefaultHTTPClient

func NewDefaultHTTPClient(t *testing.T) *http.Client

func NewIAMClient

func NewIAMClient(t *testing.T) *iam.Service

func NewResourceManagerClient

func NewResourceManagerClient(t *testing.T) *cloudresourcemanager.Service

func NewStorageClient

func NewStorageClient(t *testing.T) *storage.Service

func ResourceSupportsDeletion

func ResourceSupportsDeletion(resourceKind string) bool

Types

type GCPProject added in v1.100.0

type GCPProject struct {
	ProjectID     string
	ProjectNumber int64
}

func GetDefaultProject added in v1.100.0

func GetDefaultProject(t *testing.T) GCPProject

GetDefaultProject returns the ID of user's configured default GCP project.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL