From 6c94bc626b6fb41ef369f8f9f84394afa30df959 Mon Sep 17 00:00:00 2001 From: Volodymyr Manilo Date: Wed, 21 Feb 2024 19:57:58 +0100 Subject: [PATCH] fix test with long unique name --- .../internal/test/acctests/datasource/connectors_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/twingate/internal/test/acctests/datasource/connectors_test.go b/twingate/internal/test/acctests/datasource/connectors_test.go index 2b480457..2e923147 100644 --- a/twingate/internal/test/acctests/datasource/connectors_test.go +++ b/twingate/internal/test/acctests/datasource/connectors_test.go @@ -287,7 +287,6 @@ func TestAccDatasourceTwingateConnectorsFilterByContains(t *testing.T) { t.Parallel() connectorName := test.RandomConnectorName() - contains := connectorName[len(connectorName)-7 : len(connectorName)-2] resourceName := test.RandomResourceName() theDatasource := "data.twingate_connectors." + resourceName @@ -297,7 +296,7 @@ func TestAccDatasourceTwingateConnectorsFilterByContains(t *testing.T) { CheckDestroy: acctests.CheckTwingateResourceDestroy, Steps: []resource.TestStep{ { - Config: testDatasourceTwingateConnectorsFilter(resourceName, test.RandomName(), connectorName, attr.FilterByContains, contains), + Config: testDatasourceTwingateConnectorsFilter(resourceName, test.RandomName(), connectorName, attr.FilterByContains, connectorName), Check: acctests.ComposeTestCheckFunc( resource.TestCheckResourceAttr(theDatasource, connectorsLen, "1"), resource.TestCheckResourceAttr(theDatasource, connectorNamePath, connectorName), @@ -311,7 +310,6 @@ func TestAccDatasourceTwingateConnectorsFilterByRegexp(t *testing.T) { t.Parallel() connectorName := test.RandomConnectorName() - contains := connectorName[len(connectorName)-7 : len(connectorName)-2] resourceName := test.RandomResourceName() theDatasource := "data.twingate_connectors." + resourceName @@ -321,7 +319,7 @@ func TestAccDatasourceTwingateConnectorsFilterByRegexp(t *testing.T) { CheckDestroy: acctests.CheckTwingateResourceDestroy, Steps: []resource.TestStep{ { - Config: testDatasourceTwingateConnectorsFilter(resourceName, test.RandomName(), connectorName, attr.FilterByRegexp, fmt.Sprintf(".*%s.*", contains)), + Config: testDatasourceTwingateConnectorsFilter(resourceName, test.RandomName(), connectorName, attr.FilterByRegexp, fmt.Sprintf(".*%s.*", connectorName)), Check: acctests.ComposeTestCheckFunc( resource.TestCheckResourceAttr(theDatasource, connectorsLen, "1"), resource.TestCheckResourceAttr(theDatasource, connectorNamePath, connectorName),