mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 06:41:49 +08:00
Plugins: Add missing asserts for Plugin Errors field (#51702)
* make sure to check plugin errors * remove unused test
This commit is contained in:
@ -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)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user