Plugins: Add missing asserts for Plugin Errors field (#51702)

* make sure to check plugin errors

* remove unused test
This commit is contained in:
Will Browne
2022-07-04 13:03:50 +02:00
committed by GitHub
parent 6af8189816
commit 0b40c8e51e

View File

@ -531,8 +531,8 @@ func TestLoader_Load_MultiplePlugins(t *testing.T) {
}, },
}, },
pluginErrors: map[string]*plugins.Error{ pluginErrors: map[string]*plugins.Error{
"test": { "test-panel": {
PluginID: "test", PluginID: "test-panel",
ErrorCode: "signatureMissing", ErrorCode: "signatureMissing",
}, },
}, },
@ -556,6 +556,11 @@ func TestLoader_Load_MultiplePlugins(t *testing.T) {
if !cmp.Equal(got, tt.want, compareOpts) { if !cmp.Equal(got, tt.want, compareOpts) {
t.Fatalf("Result mismatch (-want +got):\n%s", cmp.Diff(got, tt.want, compareOpts)) t.Fatalf("Result mismatch (-want +got):\n%s", cmp.Diff(got, tt.want, compareOpts))
} }
pluginErrs := l.PluginErrors()
require.Equal(t, len(tt.pluginErrors), len(pluginErrs))
for _, pluginErr := range pluginErrs {
require.Equal(t, tt.pluginErrors[pluginErr.PluginID], pluginErr)
}
}) })
} }
}) })