Skip to content

Commit

Permalink
chore: update test process
Browse files Browse the repository at this point in the history
  • Loading branch information
novln committed Aug 16, 2017
1 parent bf92740 commit 178b13a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ language: go
before_install:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install
go:
- 1.7
- 1.8
script: make test
script:
- make test
- make lint
services:
- redis-server
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ cleandb:
@(redis-cli KEYS "limitertests:*" | xargs redis-cli DEL)

test: cleandb
@(go test -v -run ^Test)
@(scripts/test)

lint:
@(scripts/lint)
33 changes: 33 additions & 0 deletions gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"DisableAll": true,
"Enable": [
"lll",
"misspell",
"gofmt",
"dupl",
"ineffassign",
"errcheck",
"gas",
"vet",
"unconvert",
"interfacer",
"deadcode",
"gocyclo",
"vetshadow",
"golint",
"goconst",
"megacheck",
"varcheck",
"structcheck"
],
"EnableGC": true,
"Deadline": "1200s",
"Concurrency": 1,
"Vendor": true,
"VendoredLinters": true,
"Aggregate": true,
"Test": true,
"LineLength": 120,
"Cyclo": 10,
"DuplThreshold": 80
}
10 changes: 10 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -eo pipefail

for package in $(go list ./... | grep -v -E '\/(vendor|examples)\/')
do
path="${GOPATH}/src/${package}"
echo "[gometalinter] ${package}"
gometalinter --config gometalinter.json --disable=dupl "${path}"
done
3 changes: 3 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

go test -race -v $(go list ./... | grep -v -E '\/(vendor|examples)\/')

0 comments on commit 178b13a

Please sign in to comment.