From ec8bade12caa7a1240376fd670bb3f826b7e7a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Lafoucrie=CC=80re?= Date: Tue, 9 Mar 2021 18:43:48 -0500 Subject: [PATCH] Define a new compile func for go 1.16 `go test -i` is deprecated in go 1.16, and it makes the output parsing fail, leading to to no coverage reported. closes https://github.com/smartystreets/goconvey/issues/613 --- web/server/system/shell.go | 4 ---- web/server/system/shell_1_16.go | 7 +++++++ web/server/system/shell_older_than_1_16.go | 7 +++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 web/server/system/shell_1_16.go create mode 100644 web/server/system/shell_older_than_1_16.go diff --git a/web/server/system/shell.go b/web/server/system/shell.go index 0adb8942..1c11464b 100644 --- a/web/server/system/shell.go +++ b/web/server/system/shell.go @@ -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 diff --git a/web/server/system/shell_1_16.go b/web/server/system/shell_1_16.go new file mode 100644 index 00000000..f5099a6f --- /dev/null +++ b/web/server/system/shell_1_16.go @@ -0,0 +1,7 @@ +// +build go1.16 + +package system + +func compile(directory, gobin, tagsArg string) Command { + return NewCommand(directory, gobin, "test", tagsArg) +} diff --git a/web/server/system/shell_older_than_1_16.go b/web/server/system/shell_older_than_1_16.go new file mode 100644 index 00000000..3d90b086 --- /dev/null +++ b/web/server/system/shell_older_than_1_16.go @@ -0,0 +1,7 @@ +// +build !go1.16 + +package system + +func compile(directory, gobin, tagsArg string) Command { + return NewCommand(directory, gobin, "test", "-i", tagsArg) +}