testutils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNestedKeyExistsWithValue

func CheckNestedKeyExistsWithValue(tfNode string, propertyName string, propertyValue string) resource.TestCheckFunc

CheckNestedKeyExistsWithValue checks if a property exists with a certain value in an instance state

func CheckPipelineCheckDestroyed

func CheckPipelineCheckDestroyed(resourceType string) resource.TestCheckFunc

CheckPipelineCheckDestroyed verifies that all checks of the given type in the state are destroyed. This will be invoked *after* terraform destroys the resource but *before* the state is wiped clean.

func CheckPipelineCheckExistsWithName

func CheckPipelineCheckExistsWithName(tfNode string, expectedName string) resource.TestCheckFunc

CheckServiceEndpointExistsWithName verifies that a service endpoint of a particular type exists in the state, and that it has the expected name when compared against the data in Azure DevOps.

func CheckProjectDestroyed

func CheckProjectDestroyed(s *terraform.State) error

CheckProjectDestroyed verifies that all projects referenced in the state are destroyed. This will be invoked *after* terraform destroys the resource but *before* the state is wiped clean.

func CheckProjectExists

func CheckProjectExists(expectedName string) resource.TestCheckFunc

CheckProjectExists Given the name of an AzDO project, this will return a function that will check whether or not the project (1) exists in the state and (2) exist in AzDO and (3) has the correct name

func CheckServiceEndpointDestroyed

func CheckServiceEndpointDestroyed(resourceType string) resource.TestCheckFunc

CheckServiceEndpointDestroyed verifies that all service endpoints of the given type in the state are destroyed. This will be invoked *after* terraform destroys the resource but *before* the state is wiped clean.

func CheckServiceEndpointExistsWithName

func CheckServiceEndpointExistsWithName(tfNode string, expectedName string) resource.TestCheckFunc

CheckServiceEndpointExistsWithName verifies that a service endpoint of a particular type exists in the state, and that it has the expected name when compared against the data in Azure DevOps.

func ComputeProjectQualifiedResourceImportID

func ComputeProjectQualifiedResourceImportID(resourceNode string) resource.ImportStateIdFunc

ComputeProjectQualifiedResourceImportID returns a function that can be used to construct an import ID of a resource that has an import ID in the following form: <project ID>/<resource ID>

func GenerateResourceName

func GenerateResourceName() string

GenerateResourceName generates a random name with a constant prefix, useful for acceptance tests

func GetProvider

func GetProvider() *schema.Provider

GetProvider returns the azuredevops provider

func GetProviderFactories

func GetProviderFactories() map[string]func() (*schema.Provider, error)

func GetProviders

func GetProviders() map[string]*schema.Provider

GetProviders returns a map of all providers needed for the project

func HclAgentPoolDataSource

func HclAgentPoolDataSource() string

HclAgentPoolDataSource HCL describing a data source for an AzDO Agent Pool

func HclAgentPoolResource

func HclAgentPoolResource(poolName string) string

HclAgentPoolResource HCL describing an AzDO Agent Pool

func HclAgentPoolResourceAppendPoolNameToResourceName

func HclAgentPoolResourceAppendPoolNameToResourceName(poolName string) string

HclAgentPoolResourceAppendPoolNameToResourceName HCL describing an AzDO Agent Pool with agent pool name appended to resource name

func HclAgentPoolsDataSource

func HclAgentPoolsDataSource() string

HclAgentPoolsDataSource HCL describing a data source for an AzDO Agent Pools

func HclAgentQueueDataSource

func HclAgentQueueDataSource(projectName, queueName string) string

HclAgentQueueDataSource HCL describing a data source for an AzDO Agent Queue

func HclAgentQueueResource

func HclAgentQueueResource(projectName, poolName string) string

HclAgentQueueResource HCL describing an AzDO Agent Pool and Agent Queue

func HclBuildDefinitionDataSource

func HclBuildDefinitionDataSource(path string) string

HclBuildDefinitionDataSource HCL describing a data source for an AzDO Variable Group

func HclBuildDefinitionResource

func HclBuildDefinitionResource(
	buildDefinitionName string,
	buildPath string,
	repoType string,
	repoID string,
	branchName string,
	yamlPath string,
	serviceConnectionID string,
) string

HclBuildDefinitionResource HCL describing an AzDO build definition

func HclBuildDefinitionResourceBitbucket

func HclBuildDefinitionResourceBitbucket(projectName string, buildDefinitionName string, buildPath string, serviceConnectionID string) string

HclBuildDefinitionResourceBitbucket HCL describing an AzDO build definition sourced from Bitbucket

func HclBuildDefinitionResourceGitHub

func HclBuildDefinitionResourceGitHub(projectName string, buildDefinitionName string, buildPath string) string

HclBuildDefinitionResourceGitHub HCL describing an AzDO build definition sourced from GitHub

func HclBuildDefinitionResourceTfsGit

func HclBuildDefinitionResourceTfsGit(projectName string, gitRepoName string, buildDefinitionName string, buildPath string) string

HclBuildDefinitionResourceTfsGit HCL describing an AzDO build definition sourced from AzDo Git Repo

func HclBuildDefinitionResourceWithProject

func HclBuildDefinitionResourceWithProject(
	projectName string,
	buildDefinitionName string,
	buildPath string,
	repoType string,
	repoID string,
	branchName string,
	yamlPath string,
	serviceConnectionID string,
) string

HclBuildDefinitionResourceWithProject HCL describing an AzDO build definition and a project

func HclBuildDefinitionWithVariables

func HclBuildDefinitionWithVariables(varValue, secretVarValue, name string) string

HclBuildDefinitionWithVariables A build definition with variables

func HclBuildFolder

func HclBuildFolder(projectName string, path string, description string) string

HclBuildFolder creates HCL for testing Build Folders

func HclDefinitionResourceAuthorization

func HclDefinitionResourceAuthorization(resourceID, definitionID, resourceType string, authorized bool) string

HclDefinitionResourceAuthorization HCL describing a resource authorization

func HclEnvironmentResource

func HclEnvironmentResource(projectName string, environmentName string) string

HclEnvironmentResource HCL describing an AzDO environment resource

func HclEnvironmentResourceKubernetes

func HclEnvironmentResourceKubernetes(projectName string, environmentName string, serviceEndpointName string, resourceName string) string

HclEnvironmentResourceKubernetesResource HCL describing an AzDO environment kubernetes resource

func HclForkedGitRepoResource

func HclForkedGitRepoResource(projectName string, gitRepoName string, gitForkedRepoName string, initType string, forkedInitType string) string

HclForkedGitRepoResource HCL describing an AzDO GIT repository resource

func HclGitPermissions

func HclGitPermissions(projectName string) string

HclGitPermissions creates HCl for testing to set permissions for a the all Git repositories of AzDO project

func HclGitPermissionsForRepository

func HclGitPermissionsForRepository(projectName string, gitRepoName string) string

HclGitPermissionsForRepository creates HCl for testing to set permissions for a the all Git repositories of AzDO project

func HclGitRepoFileResource

func HclGitRepoFileResource(projectName, gitRepoName, initType, branch, file, content string) string

HclGitRepoFileResource HCl describing a file in an AzDO GIT repository

func HclGitRepoResource

func HclGitRepoResource(projectName string, gitRepoName string, initType string) string

HclGitRepoResource HCL describing an AzDO GIT repository resource

func HclGroupDataSource

func HclGroupDataSource(projectName string, groupName string) string

HclGroupDataSource HCL describing an AzDO Group Data Source

func HclGroupEntitlementResource

func HclGroupEntitlementResource(displayName string) string

HclGroupEntitlementResource HCL describing an AzDO GroupEntitlement

func HclGroupEntitlementResourceAAD

func HclGroupEntitlementResourceAAD(originId string) string

HclGroupEntitlementResource HCL describing an AzDO GroupEntitlement linked with Azure AD

func HclGroupMembershipDependencies

func HclGroupMembershipDependencies(projectName, groupName, userPrincipalName string) string

HclGroupMembershipDependencies all the dependencies needed to configure a group membership

func HclGroupMembershipResource

func HclGroupMembershipResource(projectName, groupName, userPrincipalName string) string

HclGroupMembershipResource full terraform stanza to standup a group membership

func HclGroupResource

func HclGroupResource(groupResourceName, projectName, groupName string) string

HclGroupResource HCL describing an AzDO group, if the projectName is empty, only a azuredevops_group instance is returned

func HclProjectFeatures

func HclProjectFeatures(projectName string, featureStateTestplans string, featureStateArtifacts string) string

HclProjectFeatures HCL describing an AzDO project including feature setup using azuredevops_git_repositories

func HclProjectGitRepoImportPrivate

func HclProjectGitRepoImportPrivate(projectName, gitRepoName, gitImportRepoName, serviceEndpointName string) string

func HclProjectGitRepositories

func HclProjectGitRepositories(projectName string, gitRepoName string) string

HclProjectGitRepositories HCL describing a multi value data source for AzDO git repositories

func HclProjectGitRepository

func HclProjectGitRepository(projectName string, gitRepoName string) string

HclProjectGitRepository HCL describing a single-value data source for an AzDO git repository

func HclProjectGitRepositoryImport

func HclProjectGitRepositoryImport(gitRepoName string, projectName string) string

HclProjectGitRepositoryImport HCL describing a AzDO git repositories

func HclProjectPermissions

func HclProjectPermissions(projectName string) string

HclProjectPermissions creates HCL for testing to set permissions for a AzDO project

func HclProjectPipelineSettings

func HclProjectPipelineSettings(projectName string, enforceJobAuthScope, enforceReferencedRepoScopedToken, enforceSettableVar, publishPipelineMetadata, statusBadgesArePrivate, enforceJobAuthScopeForReleases bool) string

HclProjectFeatures HCL describing an AzDO project including feature setup using azuredevops_git_repositories

func HclProjectResource

func HclProjectResource(projectName string) string

HclProjectResource HCL describing an AzDO project

func HclProjectResourceWithFeature

func HclProjectResourceWithFeature(projectName string, featureStateTestplans string, featureStateArtifacts string) string

HclProjectResourceWithFeature HCL describing an AzDO project including internal feature setup

func HclProjectsDataSource

func HclProjectsDataSource(projectName string) string

HclProjectsDataSource HCL describing a data source for multiple AzDO projects

func HclProjectsDataSourceWithStateAndInvalidName

func HclProjectsDataSourceWithStateAndInvalidName() string

HclProjectsDataSourceWithStateAndInvalidName creates HCL for a multi value data source for AzDo projects

func HclResourceAuthorization

func HclResourceAuthorization(resourceID string, authorized bool) string

HclResourceAuthorization HCL describing a resource authorization

func HclServiceEndpointAzureCRResource

func HclServiceEndpointAzureCRResource(projectName string, serviceEndpointName string) string

HclServiceEndpointAzureCRResource HCL describing an AzDO service endpoint

func HclServiceEndpointAzureRMAutomaticResourceWithProject

func HclServiceEndpointAzureRMAutomaticResourceWithProject(projectName string, serviceEndpointName string, serviceEndpointAuthenticationScheme string, subscriptionId string, subscriptionName string, tenantId string) string

HclServiceEndpointAzureRMAutomaticResourceWithProject HCL describing an AzDO service endpoint

func HclServiceEndpointAzureRMDataSourceWithServiceEndpointID

func HclServiceEndpointAzureRMDataSourceWithServiceEndpointID() string

HclServiceEndpointAzureRMDataSourceWithServiceEndpointID HCL describing a data source for an AzDO service endpoint

func HclServiceEndpointAzureRMDataSourceWithServiceEndpointName

func HclServiceEndpointAzureRMDataSourceWithServiceEndpointName(serviceEndpointName string) string

HclServiceEndpointAzureRMDataSourceWithServiceEndpointName HCL describing a data source for an AzDO service endpoint

func HclServiceEndpointAzureRMNoKeyResource

func HclServiceEndpointAzureRMNoKeyResource(projectName string, serviceEndpointName string, serviceprincipalid string, serviceEndpointAuthenticationScheme string) string

HclServiceEndpointAzureRMResource HCL describing an AzDO service endpoint

func HclServiceEndpointAzureRMResource

func HclServiceEndpointAzureRMResource(projectName string, serviceEndpointName string, serviceprincipalid string, serviceprincipalkey string, serviceEndpointAuthenticationScheme string) string

HclServiceEndpointAzureRMResource HCL describing an AzDO service endpoint

func HclServiceEndpointAzureRMResourceWithMG

func HclServiceEndpointAzureRMResourceWithMG(projectName string, serviceEndpointName string, serviceprincipalid string, serviceprincipalkey string) string

HclServiceEndpointAzureRMResourceMG HCL describing an AzDO service endpoint

func HclServiceEndpointAzureRMResourceWithValidate

func HclServiceEndpointAzureRMResourceWithValidate(projectName string, serviceEndpointName string, serviceprincipalid string, serviceprincipalkey string, serviceEndpointAuthenticationScheme string, validate bool) string

func HclServiceEndpointDockerRegistryResource

func HclServiceEndpointDockerRegistryResource(projectName string, serviceEndpointName string) string

HclServiceEndpointDockerRegistryResource HCL describing an AzDO service endpoint

func HclServiceEndpointGenericResource

func HclServiceEndpointGenericResource(projectName string, serviceEndpointName string, serverUrl string, username string, password string) string

HclServiceEndpointGenericResource HCL describing an AzDO service endpoint

func HclServiceEndpointGitHubDataSourceWithServiceEndpointID

func HclServiceEndpointGitHubDataSourceWithServiceEndpointID() string

HclServiceEndpointGitHubDataSourceWithServiceEndpointID HCL describing a data source for an AzDO service endpoint

func HclServiceEndpointGitHubDataSourceWithServiceEndpointName

func HclServiceEndpointGitHubDataSourceWithServiceEndpointName(serviceEndpointName string) string

HclServiceEndpointGitHubDataSourceWithServiceEndpointName HCL describing a data source for an AzDO service endpoint

func HclServiceEndpointGitHubEnterpriseResource

func HclServiceEndpointGitHubEnterpriseResource(projectName string, serviceEndpointName string) string

func HclServiceEndpointGitHubResource

func HclServiceEndpointGitHubResource(projectName string, serviceEndpointName string) string

HclServiceEndpointGitHubResource HCL describing an AzDO service endpoint

func HclServiceEndpointKubernetesResource

func HclServiceEndpointKubernetesResource(projectName string, serviceEndpointName string, authorizationType string) string

HclServiceEndpointKubernetesResource HCL describing an AzDO kubernetes service endpoint

func HclServiceEndpointRunPipelineResource

func HclServiceEndpointRunPipelineResource(serviceEndpointName string, accessToken string, description string) string

func HclServiceEndpointRunPipelineResourceSimple

func HclServiceEndpointRunPipelineResourceSimple(serviceEndpointName string) string

HclServiceEndpointRunPipelineResource HCL describing an AzDO service endpoint

func HclServiceEndpointServiceFabricResource

func HclServiceEndpointServiceFabricResource(projectName string, serviceEndpointName string, authorizationType string) string

HclServiceEndpointServiceFabricResource HCL describing an AzDO service endpoint

func HclServicehookStorageQeueuePipelinesResourceWithStageEvent

func HclServicehookStorageQeueuePipelinesResourceWithStageEvent(projectName, accountKey, queueName, stateFilter, resultFilter string) string

HclServicehookStorageQeueuePipelinesResource HCL describing an AzDO subscription resource

func HclServicehookStorageQeueuePipelinesResourceWithoutEventConfig

func HclServicehookStorageQeueuePipelinesResourceWithoutEventConfig(projectName, accountKey, queueName, eventType string) string

func HclTeamConfiguration

func HclTeamConfiguration(projectName string, teamName string, teamDescription string, teamAdministrators *[]string, teamMembers *[]string) string

func HclUserEntitlementResource

func HclUserEntitlementResource(principalName string) string

HclUserEntitlementResource HCL describing an AzDO UserEntitlement

func HclVariableGroupDataSource

func HclVariableGroupDataSource() string

HclVariableGroupDataSource HCL describing a data source for an AzDO Variable Group

func HclVariableGroupResource

func HclVariableGroupResource(variableGroupName string, allowAccess bool) string

HclVariableGroupResource HCL describing an AzDO group

func HclVariableGroupResourceKeyVault

func HclVariableGroupResourceKeyVault(variableGroupName string, allowAccess bool, keyVaultName string) string

HclVariableGroupResourceKeyVault HCL describing an AzDO variable group with key vault

func HclVariableGroupResourceKeyVaultWithProject

func HclVariableGroupResourceKeyVaultWithProject(projectName string, variableGroupName string, allowAccess bool, keyVaultName string) string

HclVariableGroupResourceKeyVaultWithProject HCL describing an AzDO project and variable group with key vault

func HclVariableGroupResourceNoSecretsWithProject

func HclVariableGroupResourceNoSecretsWithProject(projectName string, variableGroupName string, allowAccess bool) string

HclVariableGroupResourceNoSecretsWithProject Similar to HclVariableGroupResource, but without a secret variable

func HclVariableGroupResourceWithProject

func HclVariableGroupResourceWithProject(projectName string, variableGroupName string, allowAccess bool) string

HclVariableGroupResourceWithProject HCL describing an AzDO variable group

func PreCheck

func PreCheck(t *testing.T, additionalEnvVars *[]string)

PreCheck checks that the requisite environment variables are set

func RequiresImportError

func RequiresImportError(resourceName string) *regexp.Regexp

func RunTestsInSequence

func RunTestsInSequence(t *testing.T, tests map[string]map[string]func(t *testing.T))

Types

This section is empty.

Jump to

Keyboard shortcuts

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