-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from influxdata/feat/makefile
test: Adding makefile for simplifying testing
- Loading branch information
Showing
3 changed files
with
46 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
artifacts_path := /tmp/artifacts | ||
|
||
help: | ||
@echo 'Targets:' | ||
@echo ' all - runs lint, server, coverage' | ||
@echo ' lint - runs code style checks' | ||
@echo ' shorttest - runs unit and integration tests' | ||
@echo ' test - runs all tests, including e2e tests - requires running influxdb 2 server' | ||
@echo ' coverage - runs all tests, including e2e tests, with coverage report - requires running influxdb 2 server' | ||
@echo ' server - prepares InfluxDB in docker environment' | ||
|
||
lint: | ||
go vet ./... | ||
go install honnef.co/go/tools/cmd/staticcheck@latest && staticcheck --checks='all' --tags e2e ./... | ||
go install golang.org/x/lint/golint@latest && golint ./... | ||
|
||
shorttest: | ||
go test -race -v -count=1 ./... | ||
|
||
test: | ||
go test -race -v -count=1 --tags e2e ./... | ||
|
||
coverage: | ||
go install gotest.tools/gotestsum@latest && gotestsum --junitfile /tmp/test-results/unit-tests.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg '.,./api/...,./internal/.../,./log/...' -tags e2e ./... | ||
if test ! -e $(artifacts_path); then mkdir $(artifacts_path); fi | ||
go tool cover -html=coverage.txt -o $(artifacts_path)/coverage.html | ||
|
||
server: | ||
./scripts/influxdb-restart.sh | ||
|
||
all: lint server coverage |