Skip to content

Commit 838d0ea

Browse files
committed
updated test timeout handling to address #24
1 parent fe7447f commit 838d0ea

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/gomason/golang.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ func (Golang) Test(gopath string, gomodule string, timeout string) (err error) {
168168

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

171-
var timeoutArg string
172-
171+
var cmd *exec.Cmd
172+
// 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
173173
if timeout != "" {
174-
timeoutArg = fmt.Sprintf("-timeout %s", timeout)
174+
cmd = exec.Command("go", "test", "-v", "-timeout", timeout, "./...")
175+
} else {
176+
cmd = exec.Command("go", "test", "-v", "./...")
175177
}
176178

177-
cmd := exec.Command("go", "test", "-v", timeoutArg, "./...")
178-
179179
runenv := append(os.Environ(), fmt.Sprintf("GOPATH=%s", gopath))
180180
runenv = append(runenv, "GO111MODULE=on")
181181

pkg/gomason/gomason.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
// VERSION is the current gomason version
18-
const VERSION = "2.7.0"
18+
const VERSION = "2.9.0"
1919

2020
// METADATA_FILENAME The default gomason metadata file name
2121
const METADATA_FILENAME = "metadata.json"

0 commit comments

Comments
 (0)