Skip to content

Commit

Permalink
updated test timeout handling to address #24
Browse files Browse the repository at this point in the history
  • Loading branch information
nikogura committed Jul 8, 2021
1 parent fe7447f commit 838d0ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/gomason/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ func (Golang) Test(gopath string, gomodule string, timeout string) (err error) {

log.Print("[DEBUG] Running 'go test -v ./...'.\n\n")

var timeoutArg string

var cmd *exec.Cmd
// Things break if you pass in an arg that has an empty string. Splitting it up like this fixes https://github.com/nikogura/gomason/issues/24
if timeout != "" {
timeoutArg = fmt.Sprintf("-timeout %s", timeout)
cmd = exec.Command("go", "test", "-v", "-timeout", timeout, "./...")
} else {
cmd = exec.Command("go", "test", "-v", "./...")
}

cmd := exec.Command("go", "test", "-v", timeoutArg, "./...")

runenv := append(os.Environ(), fmt.Sprintf("GOPATH=%s", gopath))
runenv = append(runenv, "GO111MODULE=on")

Expand Down
2 changes: 1 addition & 1 deletion pkg/gomason/gomason.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// VERSION is the current gomason version
const VERSION = "2.7.0"
const VERSION = "2.9.0"

// METADATA_FILENAME The default gomason metadata file name
const METADATA_FILENAME = "metadata.json"
Expand Down

0 comments on commit 838d0ea

Please sign in to comment.