From b1b88456c19e45db64758dade8bec7f3040107f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Stemmer?= Date: Sun, 6 Oct 2019 23:19:29 +0100 Subject: [PATCH] gtr: Refactor ReportBuilder flush --- pkg/gtr/builder.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/gtr/builder.go b/pkg/gtr/builder.go index 637a337..c20212c 100644 --- a/pkg/gtr/builder.go +++ b/pkg/gtr/builder.go @@ -38,8 +38,10 @@ func (b *ReportBuilder) newId() int { } func (b *ReportBuilder) flush() { - if len(b.tests) > 0 { - b.CreatePackage(b.packageName, 0) + // Create package in case we have tests or benchmarks that didn't get a + // summary. + if len(b.tests) > 0 || len(b.benchmarks) > 0 { + b.CreatePackage(b.packageName, 0, "") } }