Skip to content

Commit

Permalink
chore: Simplifies makefile (#2003)
Browse files Browse the repository at this point in the history
* simplify makefile
  • Loading branch information
lantoli authored Mar 11, 2024
1 parent 22d8c0a commit 0e99328
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
TEST?=$$(go list ./...)
ACCTEST_TIMEOUT?=300m
PARALLEL_GO_TEST?=20
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)

BINARY_NAME=terraform-provider-mongodbatlas
DESTINATION=./bin/$(BINARY_NAME)

GOFLAGS=-mod=vendor
GOOPTS="-p 2"

GITTAG=$(shell git describe --always --tags)
VERSION=$(GITTAG:v%=%)
LINKER_FLAGS=-s -w -X 'github.com/mongodb/terraform-provider-mongodbatlas/version.ProviderVersion=${VERSION}'
Expand All @@ -35,17 +31,17 @@ install: fmtcheck

.PHONY: test
test: fmtcheck
go test $(TEST) -timeout=30s -parallel=4 -race -covermode=atomic -coverprofile=coverage.out
go test ./... -timeout=30s -parallel=4 -race

.PHONY: testacc
testacc: fmtcheck
@$(eval VERSION=acc)
TF_ACC=1 go test $(TEST) -run '$(TEST_REGEX)' -v -parallel '$(PARALLEL_GO_TEST)' $(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -cover -ldflags="$(LINKER_FLAGS)"
TF_ACC=1 go test ./... -run '$(TEST_REGEX)' -v -parallel '$(PARALLEL_GO_TEST)' $(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -ldflags="$(LINKER_FLAGS)"

.PHONY: testaccgov
testaccgov: fmtcheck
@$(eval VERSION=acc)
TF_ACC=1 go test $(TEST) -run 'TestAccProjectRSGovProject_CreateWithProjectOwner' -v -parallel 1 "$(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -cover -ldflags=$(LINKER_FLAGS) "
TF_ACC=1 go test ./... -run 'TestAccProjectRSGovProject_CreateWithProjectOwner' -v -parallel 1 "$(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -ldflags=$(LINKER_FLAGS) "

.PHONY: fmt
fmt:
Expand Down Expand Up @@ -81,13 +77,6 @@ tools: ## Install dev tools
go install github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework@latest
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION)

.PHONY: check
check: test lint

.PHONY: test-compile
test-compile:
go test -c $(TEST) $(TESTARGS)

.PHONY: website-lint
website-lint:
@echo "==> Checking website against linters..."
Expand Down Expand Up @@ -137,4 +126,3 @@ scaffold-schemas:
.PHONY: generate-doc
generate-doc: ## Generate the resource documentation via tfplugindocs
./scripts/generate-doc.sh ${resource_name}

0 comments on commit 0e99328

Please sign in to comment.