testutils

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 15 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 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 GetProviders

func GetProviders() map[string]terraform.ResourceProvider

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 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 HclDefinitionResourceAuthorization

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

HclDefinitionResourceAuthorization HCL describing a resource authorization

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 added in v0.1.8

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 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 added in v0.1.6

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 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) string

HclServiceEndpointAzureRMAutomaticResourceWithProject HCL describing an AzDO service endpoint

func HclServiceEndpointAzureRMResource

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

HclServiceEndpointAzureRMResource HCL describing an AzDO service endpoint

func HclServiceEndpointDockerRegistryResource

func HclServiceEndpointDockerRegistryResource(projectName string, serviceEndpointName string) string

HclServiceEndpointDockerRegistryResource HCL describing an AzDO service endpoint

func HclServiceEndpointGitHubEnterpriseResource added in v0.1.4

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 added in v0.1.5

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

HclServiceEndpointServiceFabricResource HCL describing an AzDO service endpoint

func HclTeamConfiguration added in v0.1.7

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 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 added in v0.1.4

func RequiresImportError(resourceName string) *regexp.Regexp

func RunTestsInSequence added in v0.1.6

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