Skip to content

Commit 32665a3

Browse files
committed
pkg/covermerger: skip record without target line
Some records have only information about the function covered. Let's skip them. ~2% of the records in BigQuery don't have information about line. It is a side effect of #5850.
1 parent b00ef8d commit 32665a3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/covermerger/file_line_merger.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ type FileLineCoverMerger struct {
4242
}
4343

4444
func (a *FileLineCoverMerger) Add(record *FileRecord) {
45+
if record.StartLine < 0 {
46+
// This record doesn't have information about line coverage.
47+
// The best we sometimes have is the function name.
48+
return
49+
}
4550
if a.matchers[record.RepoCommit] == nil {
4651
if record.HitCount > 0 {
4752
a.lostFrames[record.RepoCommit]++

0 commit comments

Comments
 (0)