Skip to content

Commit 1426252

Browse files
committed
add acceptance test without dns subdomains
1 parent 9d91fc3 commit 1426252

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

internal/service/streamprivatelinkendpoint/resource_test.go

+41
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ func TestAccStreamPrivatelinkEndpoint_basic(t *testing.T) {
2626
resource.Test(t, *tc)
2727
}
2828

29+
func TestAccStreamPrivateLinkEndpoint_noDNSSubdomains(t *testing.T) {
30+
acc.SkipTestForCI(t) // needs confluent cloud resources
31+
tc := noDNSSubDomainsTestCase(t)
32+
// Tests include testing of plural data source and so cannot be run in parallel
33+
resource.Test(t, *tc)
34+
}
35+
2936
func TestAccStreamPrivatelinkEndpoint_failedUpdate(t *testing.T) {
3037
acc.SkipTestForCI(t) // needs confluent cloud resources
3138
tc := failedUpdateTestCase(t)
@@ -53,6 +60,40 @@ func basicTestCase(t *testing.T) *resource.TestCase {
5360
config = acc.GetCompleteConfluentConfig(true, true, projectID, provider, region, vendor, awsAccountID, networkID, privatelinkAccessID)
5461
)
5562

63+
return &resource.TestCase{
64+
PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckConfluentAWSPrivatelink(t) },
65+
CheckDestroy: checkDestroy,
66+
ExternalProviders: acc.ExternalProvidersOnlyConfluent(),
67+
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
68+
Steps: []resource.TestStep{
69+
{
70+
71+
Config: config,
72+
Check: checksStreamPrivatelinkEndpoint(projectID, provider, region, vendor, true),
73+
},
74+
{
75+
ResourceName: resourceName,
76+
ImportStateIdFunc: importStateIDFunc(resourceName),
77+
ImportState: true,
78+
ImportStateVerify: true,
79+
},
80+
},
81+
}
82+
}
83+
84+
func noDNSSubDomainsTestCase(t *testing.T) *resource.TestCase {
85+
t.Helper()
86+
87+
var (
88+
projectID = acc.ProjectIDExecution(t)
89+
provider = "AWS"
90+
region = "us-east-1"
91+
awsAccountID = os.Getenv("AWS_ACCOUNT_ID")
92+
networkID = os.Getenv("CONFLUENT_CLOUD_NETWORK_ID")
93+
privatelinkAccessID = os.Getenv("CONFLUENT_CLOUD_PRIVATELINK_ACCESS_ID")
94+
config = acc.GetCompleteConfluentConfig(true, false, projectID, provider, region, vendor, awsAccountID, networkID, privatelinkAccessID)
95+
)
96+
5697
return &resource.TestCase{
5798
PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckConfluentAWSPrivatelink(t) },
5899
CheckDestroy: checkDestroy,

0 commit comments

Comments
 (0)