forked from mirror/logrus
add a test target in the magefile
This commit is contained in:
parent
b02b418f8f
commit
3986c92379
|
@ -11,7 +11,4 @@ install:
|
||||||
script:
|
script:
|
||||||
- go run mage.go -v crossBuild
|
- go run mage.go -v crossBuild
|
||||||
- go run mage.go lint
|
- go run mage.go lint
|
||||||
- export GOMAXPROCS=4
|
- go run mage.go test
|
||||||
- export GORACE=halt_on_error=1
|
|
||||||
- go test -race -v ./...
|
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"github.com/magefile/mage/sh"
|
"github.com/magefile/mage/sh"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenBuildMatrix regenerates the build matrix from the current version of the go compiler
|
// getBuildMatrix returns the build matrix from the current version of the go compiler
|
||||||
func getBuildMatrix() (map[string][]string, error) {
|
func getBuildMatrix() (map[string][]string, error) {
|
||||||
jsonData, err := sh.Output("go", "tool", "dist", "list", "-json")
|
jsonData, err := sh.Output("go", "tool", "dist", "list", "-json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -69,3 +69,9 @@ func Lint() error {
|
||||||
|
|
||||||
return sh.Run(path.Join(gopath, "bin", "golangci-lint"), "run", "./...")
|
return sh.Run(path.Join(gopath, "bin", "golangci-lint"), "run", "./...")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run the test suite
|
||||||
|
func Test() error {
|
||||||
|
return sh.RunWith(map[string]string{"GORACE": "halt_on_error=1"},
|
||||||
|
"go", "test", "-race", "-v", "./...")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue