Skip to content

Commit

Permalink
Define a new compile func for go 1.16
Browse files Browse the repository at this point in the history
`go test -i` is deprecated in go 1.16, and it makes the output parsing
fail, leading to to no coverage reported.

closes #613
  • Loading branch information
gravis committed Mar 9, 2021
1 parent 7827743 commit ec8bade
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 0 additions & 4 deletions web/server/system/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ func findGoConvey(directory, gobin, packageName, tagsArg string) Command {
return NewCommand(directory, gobin, "list", "-f", "'{{.TestImports}}{{.XTestImports}}'", tagsArg, packageName)
}

func compile(directory, gobin, tagsArg string) Command {
return NewCommand(directory, gobin, "test", "-i", tagsArg)
}

func runWithCoverage(compile, goconvey Command, coverage bool, reportPath, directory, gobin, defaultTimeout, tagsArg string, customArguments []string) Command {
if compile.Error != nil || goconvey.Error != nil {
return compile
Expand Down
7 changes: 7 additions & 0 deletions web/server/system/shell_1_16.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +build go1.16

package system

func compile(directory, gobin, tagsArg string) Command {
return NewCommand(directory, gobin, "test", tagsArg)
}
7 changes: 7 additions & 0 deletions web/server/system/shell_older_than_1_16.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +build !go1.16

package system

func compile(directory, gobin, tagsArg string) Command {
return NewCommand(directory, gobin, "test", "-i", tagsArg)
}

0 comments on commit ec8bade

Please sign in to comment.