2018-12-10 10:32:28 +00:00
|
|
|
.PHONY: test
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
help: ## List targets & descriptions
|
|
|
|
@cat Makefile* | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
|
|
|
|
|
|
|
deps: ## Get dependencies
|
|
|
|
go get -d -v ./...
|
|
|
|
|
2022-03-30 09:39:59 +00:00
|
|
|
build: deps ## Build the binary
|
|
|
|
go build -a -o php-fpm_exporter main.go
|
|
|
|
|
2018-12-10 10:32:28 +00:00
|
|
|
test: ## Run tests
|
|
|
|
go test -short ./...
|
|
|
|
|
|
|
|
test-coverage: ## Create a code coverage report
|
|
|
|
mkdir -p .cover
|
|
|
|
go test -coverprofile .cover/cover.out ./...
|
|
|
|
|
|
|
|
test-coverage-html: ## Create a code coverage report in HTML
|
|
|
|
mkdir -p .cover
|
|
|
|
go test -coverprofile .cover/cover.out ./...
|
|
|
|
go tool cover -html .cover/cover.out
|
|
|
|
|
2020-03-11 23:48:34 +00:00
|
|
|
test-e2e:
|
2022-02-08 22:45:36 +00:00
|
|
|
bats test/e2e.bats
|
2020-03-11 23:48:34 +00:00
|
|
|
|
2020-03-04 05:34:23 +00:00
|
|
|
lint: ## Run linters
|
|
|
|
golangci-lint run
|
2018-12-10 10:32:28 +00:00
|
|
|
|
|
|
|
fmt: ## Fix formatting issues
|
2022-03-30 09:39:59 +00:00
|
|
|
goimports -w .
|