Skip to content

Commit 3a0ba4f

Browse files
committed
chore: fix some tests by making them non-parallel
1 parent a107b8c commit 3a0ba4f

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

netbox/data_source_netbox_virtual_machines_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func TestAccNetboxVirtualMachinesDataSource_basic(t *testing.T) {
1111
testSlug := "vm_ds_basic"
1212
testName := testAccGetTestName(testSlug)
1313
dependencies := testAccNetboxVirtualMachineDataSourceDependencies(testName)
14-
resource.ParallelTest(t, resource.TestCase{
14+
resource.Test(t, resource.TestCase{
1515
Providers: testAccProviders,
1616
Steps: []resource.TestStep{
1717
{
@@ -76,7 +76,7 @@ func TestAccNetboxVirtualMachinesDataSource_tags(t *testing.T) {
7676
testSlug := "vm_ds_tags"
7777
testName := testAccGetTestName(testSlug)
7878
dependencies := testAccNetboxVirtualMachineDataSourceDependenciesWithTags(testName)
79-
resource.ParallelTest(t, resource.TestCase{
79+
resource.Test(t, resource.TestCase{
8080
Providers: testAccProviders,
8181
Steps: []resource.TestStep{
8282
{

netbox/resource_netbox_ip_address_test.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,21 @@ resource "netbox_ip_address" "test" {
204204
ImportStateVerify: true,
205205
ImportStateVerifyIgnore: []string{"interface_id", "object_type"},
206206
},
207+
},
208+
})
209+
}
210+
211+
func TestAccNetboxIPAddress_cf(t *testing.T) {
212+
testIP := "1.1.1.8/32"
213+
testSlug := "ipaddr_cf"
214+
testName := testAccGetTestName(testSlug)
215+
resource.Test(t, resource.TestCase{
216+
Providers: testAccProviders,
217+
Steps: []resource.TestStep{
207218
{
208219
Config: testAccNetboxIPAddressFullDependencies(testName) + fmt.Sprintf(`
209220
resource "netbox_custom_field" "test" {
210-
name = "test"
221+
name = "%s"
211222
type = "text"
212223
weight = 100
213224
content_types = ["ipam.ipaddress"]
@@ -216,11 +227,11 @@ resource "netbox_ip_address" "test_customfield" {
216227
ip_address = "%s"
217228
status = "active"
218229
custom_fields = {
219-
"${netbox_custom_field.test.name}" = "test-field"
230+
"${netbox_custom_field.test.name}" = "test-field"
220231
}
221-
}`, testIP),
232+
}`, testSlug, testIP),
222233
Check: resource.ComposeTestCheckFunc(
223-
resource.TestCheckResourceAttr("netbox_ip_address.test_customfield", "custom_fields.test", "test-field"),
234+
resource.TestCheckResourceAttr("netbox_ip_address.test_customfield", fmt.Sprintf("custom_fields.%s", testSlug), "test-field"),
224235
),
225236
},
226237
{

netbox/resource_netbox_prefix_test.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,24 @@ resource "netbox_prefix" "test" {
230230
ImportState: true,
231231
ImportStateVerify: true,
232232
},
233+
},
234+
})
235+
}
236+
237+
func TestAccNetboxPrefix_cf(t *testing.T) {
238+
testPrefix := "1.1.2.128/25"
239+
testSlug := "prefix_cf"
240+
testVid := "124"
241+
randomSlug := testAccGetTestName(testSlug)
242+
testDesc := "test cf prefix"
243+
testName := testAccGetTestName(testSlug)
244+
resource.Test(t, resource.TestCase{
245+
Providers: testAccProviders,
246+
Steps: []resource.TestStep{
233247
{
234248
Config: testAccNetboxPrefixFullDependencies(testName, randomSlug, testVid) + fmt.Sprintf(`
235249
resource "netbox_custom_field" "test" {
236-
name = "test"
250+
name = "%s"
237251
type = "text"
238252
weight = 100
239253
content_types = ["ipam.prefix"]
@@ -243,15 +257,14 @@ resource "netbox_prefix" "test" {
243257
prefix = "%s"
244258
description = "%s 2"
245259
status = "active"
246-
tags = [netbox_tag.test.name]
247260
mark_utilized = true
248261
249262
custom_fields = {
250263
"${netbox_custom_field.test.name}" = "test-field"
251264
}
252-
}`, testPrefix, testDesc),
265+
}`, testSlug, testPrefix, testDesc),
253266
Check: resource.ComposeTestCheckFunc(
254-
resource.TestCheckResourceAttr("netbox_prefix.test", "custom_fields.test", "test-field"),
267+
resource.TestCheckResourceAttr("netbox_prefix.test", fmt.Sprintf("custom_fields.%s", testSlug), "test-field"),
255268
),
256269
},
257270
{

0 commit comments

Comments
 (0)