diff --git a/pkg/config/checks.go b/pkg/config/checks.go index 83b4fb998..5404234ab 100644 --- a/pkg/config/checks.go +++ b/pkg/config/checks.go @@ -22,7 +22,6 @@ import ( var ( // BuiltInChecks contains the checks that come pre-installed w/ Polaris BuiltInChecks = map[string]SchemaCheck{} - schemaBox = (*packr.Box)(nil) // We explicitly set the order to avoid thrash in the // tests as we migrate toward JSON schema checkOrder = []string{ @@ -72,7 +71,7 @@ var ( ) func init() { - schemaBox = packr.New("Schemas", "../../checks") + schemaBox := packr.New("Schemas", "../../checks") for _, checkID := range checkOrder { contents, err := schemaBox.Find(checkID + ".yaml") if err != nil { diff --git a/pkg/config/checks_test.go b/pkg/config/checks_test.go new file mode 100644 index 000000000..cf38f3933 --- /dev/null +++ b/pkg/config/checks_test.go @@ -0,0 +1,16 @@ +package config + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestRequiredFieldsOnBuiltInChecks(t *testing.T) { + for _, v := range BuiltInChecks { + assert.NotEmpty(t, v.SuccessMessage) + assert.NotEmpty(t, v.FailureMessage) + assert.NotEmpty(t, v.Category) + assert.NotEmpty(t, v.Target) + } +}