Skip to content

Commit 484816f

Browse files
authored
Merge branch 'main' into aledbf/s3-upload
2 parents 4c1ae14 + 0ca9de0 commit 484816f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/leeway/reporter.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,15 @@ func (r *ConsoleReporter) PackageBuildFinished(pkg *Package, rep *PackageBuildRe
220220
coverage = color.Sprintf("<fg=yellow>test coverage: %d%%</> <gray>(%d of %d functions have tests)</>\n", rep.TestCoveragePercentage, rep.FunctionsWithTest, rep.FunctionsWithTest+rep.FunctionsWithoutTest)
221221
}
222222
msg := color.Sprintf("%s<green>package build succeeded</> <gray>(%.2fs)</>\n", coverage, dur.Seconds())
223+
223224
if rep.Error != nil {
224225
msg = color.Sprintf("<red>package build failed while %sing</>\n<white>Reason:</> %s\n", rep.LastPhase(), rep.Error)
226+
} else {
227+
var coverage string
228+
if rep.TestCoverageAvailable {
229+
coverage = color.Sprintf("<fg=yellow>test coverage: %d%%</> <gray>(%d of %d functions have tests)</>\n", rep.TestCoveragePercentage, rep.FunctionsWithTest, rep.FunctionsWithTest+rep.FunctionsWithoutTest)
230+
}
231+
msg = color.Sprintf("%s<green>package build succeded</> <gray>(%.2fs)</>\n", coverage, dur.Seconds())
225232
}
226233
//nolint:errcheck
227234
io.WriteString(out, msg)

0 commit comments

Comments
 (0)