@@ -348,6 +348,56 @@ func TestAccTFERegistryModule_vcsRepoWithTags(t *testing.T) {
348
348
})
349
349
}
350
350
351
+ func TestAccTFERegistryModule_branchOnlyMonorepo (t * testing.T ) {
352
+ skipUnlessBeta (t )
353
+ rInt := rand .New (rand .NewSource (time .Now ().UnixNano ())).Int ()
354
+
355
+ resource .Test (t , resource.TestCase {
356
+ PreCheck : func () {
357
+ testAccPreCheck (t )
358
+ testAccPreCheckTFERegistryModule (t )
359
+ },
360
+ ProtoV5ProviderFactories : testAccMuxedProviders ,
361
+ Steps : []resource.TestStep {
362
+ {
363
+ Config : testAccTFERegistryModule_branchOnlyMonorepo (rInt ),
364
+ Check : resource .ComposeTestCheckFunc (
365
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "publishing_mechanism" , "branch" ),
366
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "test_config.0.tests_enabled" , strconv .FormatBool (false )),
367
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.tags" , strconv .FormatBool (false )),
368
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.branch" , "main" ),
369
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.source_directory" , "src" ),
370
+ ),
371
+ },
372
+ },
373
+ })
374
+ }
375
+
376
+ func TestAccTFERegistryModule_vcsRepoWithTagPrefixMonorepo (t * testing.T ) {
377
+ skipUnlessBeta (t )
378
+ rInt := rand .New (rand .NewSource (time .Now ().UnixNano ())).Int ()
379
+
380
+ resource .Test (t , resource.TestCase {
381
+ PreCheck : func () {
382
+ testAccPreCheck (t )
383
+ testAccPreCheckTFERegistryModule (t )
384
+ },
385
+ ProtoV5ProviderFactories : testAccMuxedProviders ,
386
+ Steps : []resource.TestStep {
387
+ {
388
+ Config : testAccTFERegistryModule_vcsRepoWithTagPrefixMonorepo (rInt ),
389
+ Check : resource .ComposeTestCheckFunc (
390
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "publishing_mechanism" , "branch" ),
391
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "test_config.0.tests_enabled" , strconv .FormatBool (false )),
392
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.tags" , strconv .FormatBool (false )),
393
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.branch" , "main" ),
394
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.source_directory" , "src" ),
395
+ resource .TestCheckResourceAttr ("tfe_registry_module.foobar" , "vcs_repo.0.tag_prefix" , "v" ),
396
+ },
397
+ },
398
+ })
399
+ }
400
+
351
401
func TestAccTFERegistryModule_noCodeModule (t * testing.T ) {
352
402
skipIfEnterprise (t )
353
403
@@ -1427,6 +1477,37 @@ resource "tfe_registry_module" "foobar" {
1427
1477
envGithubRegistryModuleIdentifer )
1428
1478
}
1429
1479
1480
+ func testAccTFERegistryModule_branchOnlyMonorepo (rInt int ) string {
1481
+ return fmt .Sprintf (`
1482
+ resource "tfe_organization" "foobar" {
1483
+ name = "tst-terraform-%d"
1484
+
1485
+ }
1486
+
1487
+ resource "tfe_oauth_client" "foobar" {
1488
+ organization = tfe_organization.foobar.name
1489
+ api_url = "https://api.github.com"
1490
+ http_url = "https://github.com"
1491
+ oauth_token = "%s"
1492
+ service_provider = "github"
1493
+ }
1494
+
1495
+ resource "tfe_registry_module" "foobar" {
1496
+ organization = tfe_organization.foobar.name
1497
+ vcs_repo {
1498
+ display_identifier = "%s"
1499
+ identifier = "%s"
1500
+ oauth_token_id = tfe_oauth_client.foobar.oauth_token_id
1501
+ branch = "main"
1502
+ source_directory = "src"
1503
+ }
1504
+ }` ,
1505
+ rInt ,
1506
+ envGithubToken ,
1507
+ envGithubRegistryModuleIdentifer ,
1508
+ envGithubRegistryModuleIdentifer )
1509
+ }
1510
+
1430
1511
func testAccTFERegistryModule_branchOnlyEmpty (rInt int ) string {
1431
1512
return fmt .Sprintf (`
1432
1513
resource "tfe_organization" "foobar" {
@@ -1518,6 +1599,39 @@ resource "tfe_registry_module" "foobar" {
1518
1599
envGithubRegistryModuleIdentifer )
1519
1600
}
1520
1601
1602
+ func testAccTFERegistryModule_vcsRepoWithTagPrefixMonorepo (rInt int ) string {
1603
+ return fmt .Sprintf (`
1604
+ resource "tfe_organization" "foobar" {
1605
+ name = "tst-terraform-%d"
1606
+
1607
+ }
1608
+
1609
+ resource "tfe_oauth_client" "foobar" {
1610
+ organization = tfe_organization.foobar.name
1611
+ api_url = "https://api.github.com"
1612
+ http_url = "https://github.com"
1613
+ oauth_token = "%s"
1614
+ service_provider = "github"
1615
+ }
1616
+
1617
+ resource "tfe_registry_module" "foobar" {
1618
+ organization = tfe_organization.foobar.name
1619
+ vcs_repo {
1620
+ display_identifier = "%s"
1621
+ identifier = "%s"
1622
+ oauth_token_id = tfe_oauth_client.foobar.oauth_token_id
1623
+ branch = "main"
1624
+ tags = false
1625
+ tag_prefix = "v"
1626
+ source_directory = "src"
1627
+ }
1628
+ }` ,
1629
+ rInt ,
1630
+ envGithubToken ,
1631
+ envGithubRegistryModuleIdentifer ,
1632
+ envGithubRegistryModuleIdentifer )
1633
+ }
1634
+
1521
1635
func testAccTFERegistryModule_GitHubApp (rInt int ) string {
1522
1636
return fmt .Sprintf (`
1523
1637
resource "tfe_organization" "foobar" {
0 commit comments