Skip to content

Commit a971941

Browse files
committed
Update acceptance tests for inventory
1 parent 209a3e5 commit a971941

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ testacc:
1818
@echo "==> Running acceptance tests..."
1919
TF_ACC=1 AAP_HOST="https://localhost:8043" AAP_INSECURE_SKIP_VERIFY=true go test -count=1 -v ./...
2020

21+
testacc-aapdev:
22+
@echo "==> Running acceptance tests..."
23+
TF_ACC=1 AAP_HOST="http://localhost:9080" AAP_INSECURE_SKIP_VERIFY=true go test -count=1 -v ./...
24+
2125
gofmt:
2226
@echo "==> Format code using gofmt..."
2327
gofmt -s -w internal/provider

internal/provider/inventory_data_source_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestAccInventoryDataSource(t *testing.T) {
106106
PreCheck: func() { testAccPreCheck(t) },
107107
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
108108
Steps: []resource.TestStep{
109-
// Step 1: Create an inventory and Read
109+
// Read
110110
{
111111
Config: testAccInventoryDataSource(randomName),
112112
Check: resource.ComposeAggregateTestCheckFunc(

internal/provider/inventory_resource.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,7 @@ func (r *InventoryResource) Schema(_ context.Context, _ resource.SchemaRequest,
116116
Description: "URL of the inventory",
117117
},
118118
"named_url": schema.StringAttribute{
119-
Computed: true,
120-
PlanModifiers: []planmodifier.String{
121-
stringplanmodifier.UseStateForUnknown(),
122-
},
119+
Computed: true,
123120
Description: "Named URL of the inventory",
124121
},
125122
"name": schema.StringAttribute{

internal/provider/inventory_resource_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ func TestAccInventoryResource(t *testing.T) {
190190
testAccCheckInventoryResourceValues(&inventory, randomName, "", ""),
191191
resource.TestCheckResourceAttr("aap_inventory.test", "name", randomName),
192192
resource.TestCheckResourceAttr("aap_inventory.test", "organization", "1"),
193+
resource.TestCheckResourceAttr("aap_inventory.test", "organization_name", "Default"),
194+
resource.TestCheckResourceAttrSet("aap_inventory.test", "named_url"),
193195
resource.TestCheckResourceAttrSet("aap_inventory.test", "id"),
194196
resource.TestCheckResourceAttrSet("aap_inventory.test", "url"),
195197
),
@@ -204,6 +206,7 @@ func TestAccInventoryResource(t *testing.T) {
204206
resource.TestCheckResourceAttr("aap_inventory.test", "organization", "1"),
205207
resource.TestCheckResourceAttr("aap_inventory.test", "description", updatedDescription),
206208
resource.TestCheckResourceAttr("aap_inventory.test", "variables", updatedVariables),
209+
resource.TestCheckResourceAttr("aap_inventory.test", "named_url", fmt.Sprintf("/api/controller/v2/inventories/%s++%s/", updatedName, "Default")),
207210
resource.TestCheckResourceAttrSet("aap_inventory.test", "id"),
208211
resource.TestCheckResourceAttrSet("aap_inventory.test", "url"),
209212
),

0 commit comments

Comments
 (0)