Skip to content

Commit

Permalink
fix: Use non-conflicting ASNs in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
fbreckle committed Jan 2, 2023
1 parent dc38ac1 commit f0e62ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions netbox/data_source_netbox_asn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -33,7 +33,7 @@ data "netbox_asn" "test" {
func testAccNetboxAsnByAsn() string {
return `
data "netbox_asn" "test" {
asn = "123"
asn = "456"
}`
}

Expand All @@ -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"),
),
},
{
Expand All @@ -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"),
),
},
},
Expand Down
4 changes: 3 additions & 1 deletion netbox/data_source_netbox_asns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down
2 changes: 1 addition & 1 deletion netbox/data_source_netbox_site_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "netbox_rir" "test" {
}
resource "netbox_asn" "test" {
asn = 123
asn = 234
rir_id = netbox_rir.test.id
}
Expand Down

0 comments on commit f0e62ea

Please sign in to comment.