Bump Go versions for Travis, fix tests

Replace gometalinter with golangci-lint.

Fix system tests (wheezy is gone, replace with stretch).

Fix linter warnings.
This commit is contained in:
Andrey Smirnov
2019-06-28 20:56:35 +03:00
parent e2d6a53de5
commit 2c91bcdc30
116 changed files with 1503 additions and 1067 deletions
+3 -14
View File
@@ -11,13 +11,10 @@ TESTS?=
BINPATH?=$(GOPATH)/bin
RUN_LONG_TESTS?=yes
GO_1_10_AND_HIGHER=$(shell (printf '%s\n' go1.10 $(GOVERSION) | sort -cV >/dev/null 2>&1) && echo "yes")
all: test bench check system-test
prepare:
go get -u github.com/alecthomas/gometalinter
gometalinter --install
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.17.1
dev:
go get -u github.com/golang/dep/...
@@ -25,11 +22,7 @@ dev:
check: system/env
ifeq ($(RUN_LONG_TESTS), yes)
if [ -x travis_wait ]; then \
travis_wait gometalinter --config=linter.json ./...; \
else \
gometalinter --config=linter.json ./...; \
fi
golangci-lint run
. system/env/bin/activate && flake8 --max-line-length=200 --exclude=system/env/ system/
endif
@@ -51,14 +44,10 @@ ifeq ($(RUN_LONG_TESTS), yes)
endif
test:
ifeq ($(GO_1_10_AND_HIGHER), yes)
go test -v ./... -gocheck.v=true -race -coverprofile=coverage.txt -covermode=atomic
else
go test -v `go list ./... | grep -v vendor/` -gocheck.v=true
endif
bench:
go test -v ./deb -run=nothing -bench=. -benchmem
go test -v ./deb -run=nothing -bench=. -benchmem
mem.png: mem.dat mem.gp
gnuplot mem.gp