Skip to content

Commit

Permalink
Add make task to run tests and coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofranssen committed Oct 15, 2021
1 parent 094f742 commit 88f5b4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist/
terraform.tfstate
terraform.tfstate.*
secrets.auto.tfvars
coverage.out
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,18 @@ release: ## creates a release using goreleaser
release-vars: ## print the release variables for goreleaser
@echo export LDFLAGS=\"$(LDFLAGS)\"
@echo export GIT_HASH=$(GIT_HASH)

.PHONY: test
test: ## runs the tests
go test -race -v -count=1 ./...

coverage.out: FORCE
go test -race -v -count=1 -covermode=atomic -coverprofile=coverage.out ./...

.PHONY: coverage.out
coverage-out: coverage.out ## Ouput code coverage to stdout
go tool cover -func=$<

.PHONY: coverage.out
coverage-html: coverage.out ## Ouput code coverage as HTML
go tool cover -html=$<

0 comments on commit 88f5b4f

Please sign in to comment.