diff --git a/Justfile b/Justfile index 4e1e74e7..46f3f3aa 100644 --- a/Justfile +++ b/Justfile @@ -59,11 +59,22 @@ lint-provider: golangci-lint run +fmt-provider: + gofmt -w pkg/config-api-provider + +test-provider: + cd {{ CONFIG_API_PROVIDER_DIR }} && TF_ACC=1 go test -v ./test/... -race -covermode=atomic -coverprofile=.coverage + +coverage-provider: + cd {{ CONFIG_API_PROVIDER_DIR }} && go tool cover -html=.coverage -o=.coverage.html + test: just test-client + just test-provider coverage: just coverage-client + coverage-provider lint: just lint-client @@ -71,6 +82,7 @@ lint: fmt: just fmt-client + just fmt-provider clean: find . -name ".coverage*" -type f -delete diff --git a/pkg/config-api-provider/test/group_test.go b/pkg/config-api-provider/test/group_test.go index 4900f8cd..d192e7f6 100644 --- a/pkg/config-api-provider/test/group_test.go +++ b/pkg/config-api-provider/test/group_test.go @@ -13,8 +13,8 @@ type Fetcher interface { func TestGroupResource(t *testing.T) { createGroupConfig := ` resource "uxi_group" "test_group" { - name = "test_name" - parent_uid = "9999" + name = "temporary_name" + parent_uid = "temporary_parent_uid" }` resource.Test(t, resource.TestCase{ @@ -24,8 +24,8 @@ func TestGroupResource(t *testing.T) { { Config: providerConfig + createGroupConfig, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.test_group", "name", "test_name"), - resource.TestCheckResourceAttr("uxi_group.test_group", "parent_uid", "9999"), + resource.TestCheckResourceAttr("uxi_group.test_group", "name", "temporary_name"), + resource.TestCheckResourceAttr("uxi_group.test_group", "parent_uid", "temporary_parent_uid"), resource.TestCheckResourceAttrSet("uxi_group.test_group", "id"), resource.TestCheckResourceAttrSet("uxi_group.test_group", "last_updated"), ),