Skip to content

Commit 922b5d4

Browse files
committed
all_test: allow duplicate summaries for unreviewed reports
Modify the corpus-wide report lint check to allow unreviewed reports to have the same summary as other (reviewed or unreviwed) reports. Reviewed reports must still have unique summaries (but may share a summary with one or more unreviewed reports). Change-Id: I8ab4fc259e019c0fb529ed0ef332cc9cfe634483 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/590279 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]>
1 parent a75c727 commit 922b5d4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

all_test.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,14 @@ func TestLintReports(t *testing.T) {
112112
aliases[alias] = filename
113113
}
114114
}
115-
if summary := r.Summary.String(); summary != "" {
116-
if report, ok := summaries[summary]; ok {
117-
t.Errorf("report %s shares duplicate summary %q with report %s", filename, summary, report)
118-
} else {
119-
summaries[summary] = filename
115+
// Ensure that each reviewed report has a unique summary.
116+
if r.IsReviewed() {
117+
if summary := r.Summary.String(); summary != "" {
118+
if report, ok := summaries[summary]; ok {
119+
t.Errorf("report %s shares duplicate summary %q with report %s", filename, summary, report)
120+
} else {
121+
summaries[summary] = filename
122+
}
120123
}
121124
}
122125
// Check that a correct OSV file was generated for each YAML report.

0 commit comments

Comments
 (0)