Skip to content

Commit

Permalink
add test to help enforce that new analyzers are added to All() (istio…
Browse files Browse the repository at this point in the history
  • Loading branch information
sushicw authored and istio-testing committed Nov 27, 2019
1 parent 5803182 commit 3252834
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions galley/pkg/config/analysis/analyzers/analyzers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,20 @@ func TestAnalyzers(t *testing.T) {
})
}

// Verify that all of the analyzers tested here are also registered in All()
func TestAnalyzersInAll(t *testing.T) {
g := NewGomegaWithT(t)

var allNames []string
for _, a := range All() {
allNames = append(allNames, a.Metadata().Name)
}

for _, tc := range testGrid {
g.Expect(allNames).To(ContainElement(tc.analyzer.Metadata().Name))
}
}

func TestAnalyzersHaveUniqueNames(t *testing.T) {
g := NewGomegaWithT(t)

Expand Down

0 comments on commit 3252834

Please sign in to comment.