Skip to content

Commit 558a095

Browse files
committed
WIP
1 parent 1793b72 commit 558a095

8 files changed

+87
-48
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,45 @@ jobs:
9292
# which runs against all tests using the list arg
9393
# lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite for CI tests only
9494
list_tests: "TestAcc.*_RunDependent"
95+
vcs-dependent-tests:
96+
name: vcs-dependent-tests
97+
runs-on: ubuntu-latest
98+
timeout-minutes: 40
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
total: [1]
103+
index: [0]
104+
steps:
105+
- name: Fetch Outputs
106+
id: tflocal
107+
uses: hashicorp-forge/terraform-cloud-action/outputs@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0
108+
with:
109+
token: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}"
110+
organization: hashicorp-v2
111+
workspace: tflocal-terraform-provider-tfe
112+
113+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
114+
115+
- uses: ./.github/actions/test-provider-tfe
116+
with:
117+
matrix_index: ${{ matrix.index }}
118+
matrix_total: ${{ matrix.total }}
119+
hostname: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).ngrok_domain }}
120+
token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_token }}
121+
testing-github-token: ${{ secrets.TESTING_GITHUB_TOKEN }}
122+
admin_configuration_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.configuration }}
123+
admin_provision_licenses_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.provision-licenses }}
124+
admin_security_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.security-maintenance }}
125+
admin_site_admin_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.site-admin }}
126+
admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }}
127+
admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }}
128+
admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }}
129+
# Run terminal cmd 'go help testflag' to learn more about -list flag
130+
# action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests
131+
# which runs against all tests using the list arg
132+
# lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite for CI tests only
133+
list_tests: "TestAcc.*_VCSDependent"
95134

96135
tests-combine-summaries:
97136
name: Combine Test Reports

internal/provider/data_source_policy_set_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) {
163163
)
164164
}
165165

166-
func TestAccTFEPolicySetDataSource_vcs(t *testing.T) {
166+
func TestAccTFEPolicySetDataSource_vcs_VCSDependent(t *testing.T) {
167167
tfeClient, err := getClientUsingEnv()
168168
if err != nil {
169169
t.Fatal(err)

internal/provider/data_source_registry_module_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func TestAccTFERegistryModuleDataSource_basicNoCodePublic(t *testing.T) {
9292
})
9393
}
9494

95-
func TestAccTFERegistryModuleDataSource_basicNoCodePrivate(t *testing.T) {
95+
func TestAccTFERegistryModuleDataSource_basicNoCodePrivate_VCSDependent(t *testing.T) {
9696
skipIfEnterprise(t)
9797

9898
dsName := "data.tfe_registry_module.test"

internal/provider/resource_tfe_no_code_module_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestAccTFENoCodeModule_basic(t *testing.T) {
4141
})
4242
}
4343

44-
func TestAccTFENoCodeModule_with_variable_options(t *testing.T) {
44+
func TestAccTFENoCodeModule_with_variable_options_VCSDependent(t *testing.T) {
4545
tfeClient, err := getClientUsingEnv()
4646
if err != nil {
4747
t.Fatalf("error getting client %v", err)
@@ -98,7 +98,7 @@ func TestAccTFENoCodeModule_with_variable_options(t *testing.T) {
9898
})
9999
}
100100

101-
func TestAccTFENoCodeModule_with_version_pin(t *testing.T) {
101+
func TestAccTFENoCodeModule_with_version_pin_VCSDependent(t *testing.T) {
102102
tfeClient, err := getClientUsingEnv()
103103
if err != nil {
104104
t.Fatalf("error getting client %v", err)

internal/provider/resource_tfe_policy_set_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ func TestAccTFEPolicySet_updateToWorkspace(t *testing.T) {
471471
})
472472
}
473473

474-
func TestAccTFEPolicySet_vcs(t *testing.T) {
474+
func TestAccTFEPolicySet_vcs_VCSDependent(t *testing.T) {
475475
tfeClient, err := getClientUsingEnv()
476476
if err != nil {
477477
t.Fatal(err)
@@ -526,7 +526,7 @@ func TestAccTFEPolicySet_vcs(t *testing.T) {
526526
})
527527
}
528528

529-
func TestAccTFEPolicySet_GithubApp(t *testing.T) {
529+
func TestAccTFEPolicySet_GithubApp_VCSDependent(t *testing.T) {
530530
tfeClient, err := getClientUsingEnv()
531531
if err != nil {
532532
t.Fatal(err)
@@ -581,7 +581,7 @@ func TestAccTFEPolicySet_GithubApp(t *testing.T) {
581581
})
582582
}
583583

584-
func TestAccTFEPolicySet_updateVCSBranch(t *testing.T) {
584+
func TestAccTFEPolicySet_updateVCSBranch_VCSDependent_VCSDependent(t *testing.T) {
585585
tfeClient, err := getClientUsingEnv()
586586
if err != nil {
587587
t.Fatal(err)
@@ -767,7 +767,7 @@ func TestAccTFEPolicySet_versionedSlugUpdate(t *testing.T) {
767767
})
768768
}
769769

770-
func TestAccTFEPolicySet_versionedNoConflicts(t *testing.T) {
770+
func TestAccTFEPolicySet_versionedNoConflicts_VCSDependent(t *testing.T) {
771771
tfeClient, err := getClientUsingEnv()
772772
if err != nil {
773773
t.Fatal(err)

internal/provider/resource_tfe_registry_module_test.go

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/hashicorp/terraform-plugin-testing/terraform"
1818
)
1919

20-
func TestAccTFERegistryModule_vcsBasic(t *testing.T) {
20+
func TestAccTFERegistryModule_vcsBasic_VCSDependent(t *testing.T) {
2121
registryModule := &tfe.RegistryModule{}
2222
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
2323
orgName := fmt.Sprintf("tst-terraform-%d", rInt)
@@ -77,7 +77,7 @@ func TestAccTFERegistryModule_vcsBasic(t *testing.T) {
7777
})
7878
}
7979

80-
func TestAccTFERegistryModule_GitHubApp(t *testing.T) {
80+
func TestAccTFERegistryModule_GitHubApp_VCSDependent(t *testing.T) {
8181
registryModule := &tfe.RegistryModule{}
8282
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
8383
orgName := fmt.Sprintf("tst-terraform-%d", rInt)
@@ -134,7 +134,7 @@ func TestAccTFERegistryModule_GitHubApp(t *testing.T) {
134134
})
135135
}
136136

137-
func TestAccTFERegistryModule_emptyVCSRepo(t *testing.T) {
137+
func TestAccTFERegistryModule_emptyVCSRepo_VCSDependent(t *testing.T) {
138138
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
139139

140140
resource.Test(t, resource.TestCase{
@@ -153,7 +153,7 @@ func TestAccTFERegistryModule_emptyVCSRepo(t *testing.T) {
153153
})
154154
}
155155

156-
func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithoutRegistryName(t *testing.T) {
156+
func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithoutRegistryName_VCSDependent(t *testing.T) {
157157
registryModule := &tfe.RegistryModule{}
158158
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
159159
orgName := fmt.Sprintf("tst-terraform-%d", rInt)
@@ -202,7 +202,7 @@ func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithoutRegistryName(t *
202202
})
203203
}
204204

205-
func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithRegistryName(t *testing.T) {
205+
func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithRegistryName_VCSDependent(t *testing.T) {
206206
registryModule := &tfe.RegistryModule{}
207207
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
208208
orgName := fmt.Sprintf("tst-terraform-%d", rInt)
@@ -251,7 +251,7 @@ func TestAccTFERegistryModule_nonVCSPrivateRegistryModuleWithRegistryName(t *tes
251251
})
252252
}
253253

254-
func TestAccTFERegistryModule_publicRegistryModule(t *testing.T) {
254+
func TestAccTFERegistryModule_publicRegistryModule_VCSDependent(t *testing.T) {
255255
registryModule := &tfe.RegistryModule{}
256256
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
257257
orgName := fmt.Sprintf("tst-terraform-%d", rInt)
@@ -300,7 +300,7 @@ func TestAccTFERegistryModule_publicRegistryModule(t *testing.T) {
300300
})
301301
}
302302

303-
func TestAccTFERegistryModule_branchOnly(t *testing.T) {
303+
func TestAccTFERegistryModule_branchOnly_VCSDependent(t *testing.T) {
304304
skipUnlessBeta(t)
305305
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
306306

@@ -324,7 +324,7 @@ func TestAccTFERegistryModule_branchOnly(t *testing.T) {
324324
})
325325
}
326326

327-
func TestAccTFERegistryModule_vcsRepoWithTags(t *testing.T) {
327+
func TestAccTFERegistryModule_vcsRepoWithTags_VCSDependent(t *testing.T) {
328328
skipUnlessBeta(t)
329329
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
330330

@@ -348,7 +348,7 @@ func TestAccTFERegistryModule_vcsRepoWithTags(t *testing.T) {
348348
})
349349
}
350350

351-
func TestAccTFERegistryModule_noCodeModule(t *testing.T) {
351+
func TestAccTFERegistryModule_noCodeModule_VCSDependent(t *testing.T) {
352352
skipIfEnterprise(t)
353353

354354
registryModule := &tfe.RegistryModule{}
@@ -402,7 +402,7 @@ func TestAccTFERegistryModule_noCodeModule(t *testing.T) {
402402
})
403403
}
404404

405-
func TestAccTFERegistryModuleImport_vcsPrivateRMDeprecatedFormat(t *testing.T) {
405+
func TestAccTFERegistryModuleImport_vcsPrivateRMDeprecatedFormat_VCSDependent(t *testing.T) {
406406
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
407407

408408
resource.Test(t, resource.TestCase{
@@ -426,7 +426,7 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMDeprecatedFormat(t *testing.T) {
426426
})
427427
}
428428

429-
func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat(t *testing.T) {
429+
func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat_VCSDependent(t *testing.T) {
430430
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
431431

432432
resource.Test(t, resource.TestCase{
@@ -450,7 +450,7 @@ func TestAccTFERegistryModuleImport_vcsPrivateRMRecommendedFormat(t *testing.T)
450450
})
451451
}
452452

453-
func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch(t *testing.T) {
453+
func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch_VCSDependent(t *testing.T) {
454454
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
455455

456456
resource.Test(t, resource.TestCase{
@@ -509,7 +509,7 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranch(t
509509
})
510510
}
511511

512-
func TestAccTFERegistryModule_branchOnlyEmpty(t *testing.T) {
512+
func TestAccTFERegistryModule_branchOnlyEmpty_VCSDependent(t *testing.T) {
513513
skipUnlessBeta(t)
514514
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
515515

@@ -533,7 +533,7 @@ func TestAccTFERegistryModule_branchOnlyEmpty(t *testing.T) {
533533
})
534534
}
535535

536-
func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWithTests(t *testing.T) {
536+
func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWithTests_VCSDependent(t *testing.T) {
537537
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
538538

539539
resource.Test(t, resource.TestCase{
@@ -574,7 +574,7 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismBranchToTagsToBranchWi
574574
})
575575
}
576576

577-
func TestAccTFERegistryModuleImport_vcsPublishingMechanismTagsToBranchToTags(t *testing.T) {
577+
func TestAccTFERegistryModuleImport_vcsPublishingMechanismTagsToBranchToTags_VCSDependent(t *testing.T) {
578578
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
579579

580580
resource.Test(t, resource.TestCase{
@@ -624,7 +624,7 @@ func TestAccTFERegistryModuleImport_vcsPublishingMechanismTagsToBranchToTags(t *
624624
})
625625
}
626626

627-
func TestAccTFERegistryModule_invalidTestConfigOnCreate(t *testing.T) {
627+
func TestAccTFERegistryModule_invalidTestConfigOnCreate_VCSDependent(t *testing.T) {
628628
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
629629

630630
resource.Test(t, resource.TestCase{
@@ -642,7 +642,7 @@ func TestAccTFERegistryModule_invalidTestConfigOnCreate(t *testing.T) {
642642
})
643643
}
644644

645-
func TestAccTFERegistryModule_invalidTestConfigOnUpdate(t *testing.T) {
645+
func TestAccTFERegistryModule_invalidTestConfigOnUpdate_VCSDependent(t *testing.T) {
646646
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
647647

648648
resource.Test(t, resource.TestCase{
@@ -669,7 +669,7 @@ func TestAccTFERegistryModule_invalidTestConfigOnUpdate(t *testing.T) {
669669
})
670670
}
671671

672-
func TestAccTFERegistryModule_vcsTagsOnlyFalse(t *testing.T) {
672+
func TestAccTFERegistryModule_vcsTagsOnlyFalse_VCSDependent(t *testing.T) {
673673
skipUnlessBeta(t)
674674
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
675675

@@ -688,7 +688,7 @@ func TestAccTFERegistryModule_vcsTagsOnlyFalse(t *testing.T) {
688688
})
689689
}
690690

691-
func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate(t *testing.T) {
691+
func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate_VCSDependent(t *testing.T) {
692692
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
693693

694694
resource.Test(t, resource.TestCase{
@@ -706,7 +706,7 @@ func TestAccTFERegistryModule_branchAndInvalidTagsOnCreate(t *testing.T) {
706706
})
707707
}
708708

709-
func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate(t *testing.T) {
709+
func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate_VCSDependent(t *testing.T) {
710710
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
711711

712712
resource.Test(t, resource.TestCase{
@@ -724,7 +724,7 @@ func TestAccTFERegistryModule_branchAndTagsEnabledOnCreate(t *testing.T) {
724724
})
725725
}
726726

727-
func TestAccTFERegistryModule_branchAndTagsDisabledOnCreate(t *testing.T) {
727+
func TestAccTFERegistryModule_branchAndTagsDisabledOnCreate_VCSDependent(t *testing.T) {
728728
skipUnlessBeta(t)
729729
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
730730

@@ -743,7 +743,7 @@ func TestAccTFERegistryModule_branchAndTagsDisabledOnCreate(t *testing.T) {
743743
})
744744
}
745745

746-
func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate(t *testing.T) {
746+
func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate_VCSDependent(t *testing.T) {
747747
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
748748

749749
resource.Test(t, resource.TestCase{
@@ -770,7 +770,7 @@ func TestAccTFERegistryModule_branchAndTagsEnabledOnUpdate(t *testing.T) {
770770
})
771771
}
772772

773-
func TestAccTFERegistryModule_branchAndTagsDisabledOnUpdate(t *testing.T) {
773+
func TestAccTFERegistryModule_branchAndTagsDisabledOnUpdate_VCSDependent(t *testing.T) {
774774
skipUnlessBeta(t)
775775
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
776776

@@ -798,7 +798,7 @@ func TestAccTFERegistryModule_branchAndTagsDisabledOnUpdate(t *testing.T) {
798798
})
799799
}
800800

801-
func TestAccTFERegistryModuleImport_nonVCSPrivateRM(t *testing.T) {
801+
func TestAccTFERegistryModuleImport_nonVCSPrivateRM_VCSDependent(t *testing.T) {
802802
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
803803

804804
resource.Test(t, resource.TestCase{
@@ -821,7 +821,7 @@ func TestAccTFERegistryModuleImport_nonVCSPrivateRM(t *testing.T) {
821821
})
822822
}
823823

824-
func TestAccTFERegistryModuleImport_publicRM(t *testing.T) {
824+
func TestAccTFERegistryModuleImport_publicRM_VCSDependent(t *testing.T) {
825825
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
826826

827827
resource.Test(t, resource.TestCase{
@@ -844,7 +844,7 @@ func TestAccTFERegistryModuleImport_publicRM(t *testing.T) {
844844
})
845845
}
846846

847-
func TestAccTFERegistryModule_invalidWithBothVCSRepoAndModuleProvider(t *testing.T) {
847+
func TestAccTFERegistryModule_invalidWithBothVCSRepoAndModuleProvider_VCSDependent(t *testing.T) {
848848
resource.Test(t, resource.TestCase{
849849
PreCheck: func() {
850850
testAccPreCheck(t)
@@ -859,7 +859,7 @@ func TestAccTFERegistryModule_invalidWithBothVCSRepoAndModuleProvider(t *testing
859859
})
860860
}
861861

862-
func TestAccTFERegistryModule_invalidRegistryName(t *testing.T) {
862+
func TestAccTFERegistryModule_invalidRegistryName_VCSDependent(t *testing.T) {
863863
resource.Test(t, resource.TestCase{
864864
PreCheck: func() {
865865
testAccPreCheck(t)
@@ -874,7 +874,7 @@ func TestAccTFERegistryModule_invalidRegistryName(t *testing.T) {
874874
})
875875
}
876876

877-
func TestAccTFERegistryModule_invalidWithModuleProviderAndNoName(t *testing.T) {
877+
func TestAccTFERegistryModule_invalidWithModuleProviderAndNoName_VCSDependent(t *testing.T) {
878878
resource.Test(t, resource.TestCase{
879879
PreCheck: func() {
880880
testAccPreCheck(t)
@@ -889,7 +889,7 @@ func TestAccTFERegistryModule_invalidWithModuleProviderAndNoName(t *testing.T) {
889889
})
890890
}
891891

892-
func TestAccTFERegistryModule_invalidWithModuleProviderAndNoOrganization(t *testing.T) {
892+
func TestAccTFERegistryModule_invalidWithModuleProviderAndNoOrganization_VCSDependent(t *testing.T) {
893893
resource.Test(t, resource.TestCase{
894894
PreCheck: func() {
895895
testAccPreCheck(t)
@@ -904,7 +904,7 @@ func TestAccTFERegistryModule_invalidWithModuleProviderAndNoOrganization(t *test
904904
})
905905
}
906906

907-
func TestAccTFERegistryModule_invalidWithNamespaceAndNoRegistryName(t *testing.T) {
907+
func TestAccTFERegistryModule_invalidWithNamespaceAndNoRegistryName_VCSDependent(t *testing.T) {
908908
resource.Test(t, resource.TestCase{
909909
PreCheck: func() {
910910
testAccPreCheck(t)
@@ -919,7 +919,7 @@ func TestAccTFERegistryModule_invalidWithNamespaceAndNoRegistryName(t *testing.T
919919
})
920920
}
921921

922-
func TestAccTFERegistryModule_invalidWithRegistryNameAndNoModuleProvider(t *testing.T) {
922+
func TestAccTFERegistryModule_invalidWithRegistryNameAndNoModuleProvider_VCSDependent(t *testing.T) {
923923
resource.Test(t, resource.TestCase{
924924
PreCheck: func() {
925925
testAccPreCheck(t)

0 commit comments

Comments
 (0)