From f0e62ea28d78abe17b017503e4d244f352b7fdc4 Mon Sep 17 00:00:00 2001 From: Fabian Breckle Date: Mon, 2 Jan 2023 18:09:48 +0100 Subject: [PATCH] fix: Use non-conflicting ASNs in testing --- netbox/data_source_netbox_asn_test.go | 8 ++++---- netbox/data_source_netbox_asns_test.go | 4 +++- netbox/data_source_netbox_site_test.go | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/netbox/data_source_netbox_asn_test.go b/netbox/data_source_netbox_asn_test.go index 6a6d25d4..2b9cf1cd 100644 --- a/netbox/data_source_netbox_asn_test.go +++ b/netbox/data_source_netbox_asn_test.go @@ -19,7 +19,7 @@ resource "netbox_tag" "test" { } resource "netbox_asn" "test" { - asn = "123" + asn = "456" rir_id = netbox_rir.test.id tags = [netbox_tag.test.slug] }`, testName) @@ -33,7 +33,7 @@ data "netbox_asn" "test" { func testAccNetboxAsnByAsn() string { return ` data "netbox_asn" "test" { - asn = "123" + asn = "456" }` } @@ -53,7 +53,7 @@ func TestAccNetboxAsnDataSource_basic(t *testing.T) { { Config: setUp, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("netbox_asn.test", "asn", "123"), + resource.TestCheckResourceAttr("netbox_asn.test", "asn", "456"), ), }, { @@ -70,7 +70,7 @@ func TestAccNetboxAsnDataSource_basic(t *testing.T) { Config: setUp + testAccNetboxAsnByTag(testName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair("data.netbox_asn.test", "id", "netbox_asn.test", "id"), - resource.TestCheckResourceAttr("data.netbox_asn.test", "asn", "123"), + resource.TestCheckResourceAttr("data.netbox_asn.test", "asn", "456"), ), }, }, diff --git a/netbox/data_source_netbox_asns_test.go b/netbox/data_source_netbox_asns_test.go index a41ca1cb..48a22b47 100644 --- a/netbox/data_source_netbox_asns_test.go +++ b/netbox/data_source_netbox_asns_test.go @@ -68,7 +68,9 @@ data "netbox_asns" "test" { func TestAccNetboxAsnsDataSource_basic(t *testing.T) { testName := testAccGetTestName("asns_ds_basic") setUp := testAccNetboxAsnsSetUp(testName) - resource.ParallelTest(t, resource.TestCase{ + // This test cannot be run in parallel with other tests, because other tests create also ASNs + // These ASNs then interfere with the __n filter test + resource.Test(t, resource.TestCase{ Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/netbox/data_source_netbox_site_test.go b/netbox/data_source_netbox_site_test.go index 45bf312d..3a9d93cc 100644 --- a/netbox/data_source_netbox_site_test.go +++ b/netbox/data_source_netbox_site_test.go @@ -15,7 +15,7 @@ resource "netbox_rir" "test" { } resource "netbox_asn" "test" { - asn = 123 + asn = 234 rir_id = netbox_rir.test.id }