-
Notifications
You must be signed in to change notification settings - Fork 190
chore: Simplifies makefile #2003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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}' | ||
|
@@ -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 | ||
Comment on lines
-38
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just for reference I see this was included originally for in #1496, but we no longer include these converage reports as PR comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, at the moment we don't include any coverage report |
||
|
||
.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: | ||
|
@@ -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 | ||
Comment on lines
-84
to
-85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we remove this? I would include additional check to this command such as fmtcheck There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not being used in GH actions or commit prechecks and i don't think anybody is using this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah okay, I was probably the only one using it xD happy to remove it then |
||
|
||
.PHONY: test-compile | ||
test-compile: | ||
go test -c $(TEST) $(TESTARGS) | ||
|
||
.PHONY: website-lint | ||
website-lint: | ||
@echo "==> Checking website against linters..." | ||
|
@@ -137,4 +126,3 @@ scaffold-schemas: | |
.PHONY: generate-doc | ||
generate-doc: ## Generate the resource documentation via tfplugindocs | ||
./scripts/generate-doc.sh ${resource_name} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while redundant I do see the value in leaving the TF_ACC env var just for clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know, if we assume "make testacc" does it i would remove it from here.
i would choose only one place to have it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q] Does this mean that TF_ACC is not needed to run acceptance tests? Including locally? If so, we should update Terraform Development Guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 I see the value in keeping it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oarbusi testacc makefile goal is: TF_ACC=1 go test ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change reverted, i'll keep it, thx for the feedback