Skip to content

Commit

Permalink
all_test: only error once per duplicate report
Browse files Browse the repository at this point in the history
Change-Id: Ia1ca09efd16420f6343c3f6f970e037cb32e2de0
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/592779
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 20, 2024
1 parent 35a8b0b commit 0fee238
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ func TestLintReports(t *testing.T) {
if len(lints) > 0 {
t.Errorf(strings.Join(lints, "\n"))
}
duplicates := make(map[string][]string)
for _, alias := range r.Aliases() {
if report, ok := aliases[alias]; ok {
t.Errorf("report %s shares duplicate alias %s with report %s", filename, alias, report)
duplicates[report] = append(duplicates[report], alias)
} else {
aliases[alias] = filename
}
}
for report, aliases := range duplicates {
t.Errorf("report %s shares duplicate alias(es) %s with report %s", filename, aliases, report)
}
// Ensure that each reviewed report has a unique summary.
if r.IsReviewed() {
if summary := r.Summary.String(); summary != "" {
Expand Down

0 comments on commit 0fee238

Please sign in to comment.