Skip to content

Commit

Permalink
all_test: allow duplicate summaries for unreviewed reports
Browse files Browse the repository at this point in the history
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
  • Loading branch information
tatianab committed Jun 5, 2024
1 parent a75c727 commit 922b5d4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,14 @@ func TestLintReports(t *testing.T) {
aliases[alias] = filename
}
}
if summary := r.Summary.String(); summary != "" {
if report, ok := summaries[summary]; ok {
t.Errorf("report %s shares duplicate summary %q with report %s", filename, summary, report)
} else {
summaries[summary] = filename
// Ensure that each reviewed report has a unique summary.
if r.IsReviewed() {
if summary := r.Summary.String(); summary != "" {
if report, ok := summaries[summary]; ok {
t.Errorf("report %s shares duplicate summary %q with report %s", filename, summary, report)
} else {
summaries[summary] = filename
}
}
}
// Check that a correct OSV file was generated for each YAML report.
Expand Down

0 comments on commit 922b5d4

Please sign in to comment.