Skip to content

Commit 7c21ae1

Browse files
authored
Do not include packages with no coverage in the output (#144)
1 parent 254a920 commit 7c21ae1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/app/table_summary.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ func (c *consoleWriter) summaryTable(
176176
case parse.ActionFail:
177177
status = c.red(status)
178178
}
179+
180+
// Skip packages with no coverage to mimic nocoverageredesign behavior (changed in github.com/golang/go/issues/24570)
181+
totalTests := len(pkg.TestsByAction(parse.ActionPass)) + len(pkg.TestsByAction(parse.ActionFail)) + len(pkg.TestsByAction(parse.ActionSkip))
182+
if pkg.Cover && pkg.Coverage == 0.0 && totalTests == 0 {
183+
continue
184+
}
185+
179186
row := summaryRow{
180187
status: status,
181188
elapsed: elapsed,

0 commit comments

Comments
 (0)