Skip to content

Commit 3986c92

Browse files
author
David Bariod
committed
add a test target in the magefile
1 parent b02b418 commit 3986c92

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@ install:
1111
script:
1212
- go run mage.go -v crossBuild
1313
- go run mage.go lint
14-
- export GOMAXPROCS=4
15-
- export GORACE=halt_on_error=1
16-
- go test -race -v ./...
17-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi
14+
- go run mage.go test

magefile.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/magefile/mage/sh"
1313
)
1414

15-
// GenBuildMatrix regenerates the build matrix from the current version of the go compiler
15+
// getBuildMatrix returns the build matrix from the current version of the go compiler
1616
func getBuildMatrix() (map[string][]string, error) {
1717
jsonData, err := sh.Output("go", "tool", "dist", "list", "-json")
1818
if err != nil {
@@ -69,3 +69,9 @@ func Lint() error {
6969

7070
return sh.Run(path.Join(gopath, "bin", "golangci-lint"), "run", "./...")
7171
}
72+
73+
// Run the test suite
74+
func Test() error {
75+
return sh.RunWith(map[string]string{"GORACE": "halt_on_error=1"},
76+
"go", "test", "-race", "-v", "./...")
77+
}

0 commit comments

Comments
 (0)