Skip to content

Commit 14fa7ed

Browse files
committed
[go] Stop building test binaries
1 parent e4d93ae commit 14fa7ed

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pkg/leeway/build.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,18 +1105,13 @@ func (p *Package) buildGo(buildctx *buildContext, wd, result string) (res *packa
11051105
commands = append(commands, []string{"gokart", "scan", "-i", gokart.AnalyzerFilename, "-x"})
11061106
}
11071107
if !cfg.DontTest && !buildctx.DontTest {
1108-
testArgs := []string{goCommand, "test", "-v"}
1108+
testCommand := []string{goCommand, "test", "-v"}
11091109
if buildctx.buildOptions.CoverageOutputPath != "" {
1110-
testArgs = append(testArgs, fmt.Sprintf("-coverprofile=%v", codecovComponentName(p.FullName())))
1110+
testCommand = append(testCommand, fmt.Sprintf("-coverprofile=%v", codecovComponentName(p.FullName())))
11111111
}
1112+
testCommand = append(testCommand, "./...")
11121113

1113-
testArgs = append(testArgs, "./...")
1114-
1115-
commands = append(commands, [][]string{
1116-
// we build the test binaries in addition to running the tests regularly, so that downstream packages can run the tests in different environments
1117-
{"sh", "-c", "mkdir _tests; for i in $(" + goCommand + " list ./...); do " + goCommand + " test -c $i; [ -e $(basename $i).test ] && mv $(basename $i).test _tests; true; done"},
1118-
testArgs,
1119-
}...)
1114+
commands = append(commands, testCommand)
11201115
}
11211116

11221117
var buildCmd []string

0 commit comments

Comments
 (0)