Skip to content

Commit

Permalink
add a test target in the magefile
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bariod committed Feb 13, 2021
1 parent b02b418 commit 3986c92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ install:
script:
- go run mage.go -v crossBuild
- go run mage.go lint
- export GOMAXPROCS=4
- export GORACE=halt_on_error=1
- go test -race -v ./...
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then go test -race -v -tags appengine ./... ; fi
- go run mage.go test
8 changes: 7 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"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) {
jsonData, err := sh.Output("go", "tool", "dist", "list", "-json")
if err != nil {
Expand Down Expand Up @@ -69,3 +69,9 @@ func Lint() error {

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", "./...")
}

0 comments on commit 3986c92

Please sign in to comment.