Skip to content

Commit

Permalink
fix test with long unique name
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanilo committed Feb 21, 2024
1 parent ac2a991 commit 6c94bc6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions twingate/internal/test/acctests/datasource/connectors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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),
Expand All @@ -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

Expand All @@ -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),
Expand Down

0 comments on commit 6c94bc6

Please sign in to comment.