MCPcopy Index your code
hub / github.com/helm/helm / TestLoadAllPluginsDir

Function TestLoadAllPluginsDir

internal/plugin/loader_test.go:214–233  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

212}
213
214func TestLoadAllPluginsDir(t *testing.T) {
215 basedir := "testdata/plugdir/good"
216 plugs, err := LoadAllDir(basedir, func(_ string, err error) error { return err })
217 require.NoError(t, err)
218 require.NotEmpty(t, plugs, "expected plugins to be loaded from %s", basedir)
219
220 plugsMap := map[string]Plugin{}
221 for _, p := range plugs {
222 plugsMap[p.Metadata().Name] = p
223 }
224
225 assert.Len(t, plugsMap, 7)
226 assert.Contains(t, plugsMap, "downloader")
227 assert.Contains(t, plugsMap, "echo-legacy")
228 assert.Contains(t, plugsMap, "echo-v1")
229 assert.Contains(t, plugsMap, "getter")
230 assert.Contains(t, plugsMap, "hello-legacy")
231 assert.Contains(t, plugsMap, "hello-v1")
232 assert.Contains(t, plugsMap, "postrenderer-v1")
233}
234
235func TestLoadAllPluginsDir_Zero(t *testing.T) {
236 cases := []struct {

Callers

nothing calls this directly

Calls 4

LoadAllDirFunction · 0.85
ContainsMethod · 0.80
MetadataMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…