Skip to content

Commit

Permalink
Run go test -v only if -v flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed May 28, 2024
1 parent 1ca44b1 commit 124562b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/leeway/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,11 @@ func (p *Package) buildGo(buildctx *buildContext, wd, result string) (res *packa
}
var reportCoverage testCoverageFunc
if !cfg.DontTest && !buildctx.DontTest {
testCommand := []string{goCommand, "test", "-v"}
testCommand := []string{goCommand, "test"}
if log.IsLevelEnabled(log.DebugLevel) {
testCommand = append(testCommand, "-v")
}

if buildctx.buildOptions.CoverageOutputPath != "" {
testCommand = append(testCommand, fmt.Sprintf("-coverprofile=%v", codecovComponentName(p.FullName())))
} else {
Expand Down

0 comments on commit 124562b

Please sign in to comment.