(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func 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 | |
| 235 | func TestLoadAllPluginsDir_Zero(t *testing.T) { |
| 236 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…