(t *testing.T, ids ...string)
| 321 | } |
| 322 | |
| 323 | func makePluginDir(t *testing.T, ids ...string) string { |
| 324 | t.Helper() |
| 325 | root := t.TempDir() |
| 326 | archDir := filepath.Join(root, runtime.GOOS, runtime.GOARCH) |
| 327 | if errMkdirAll := os.MkdirAll(archDir, 0o755); errMkdirAll != nil { |
| 328 | t.Fatalf("MkdirAll() error = %v", errMkdirAll) |
| 329 | } |
| 330 | for _, id := range ids { |
| 331 | path := filepath.Join(archDir, id+pluginExtension(runtime.GOOS)) |
| 332 | if errWriteFile := os.WriteFile(path, []byte("x"), 0o644); errWriteFile != nil { |
| 333 | t.Fatalf("WriteFile(%s) error = %v", path, errWriteFile) |
| 334 | } |
| 335 | } |
| 336 | return root |
| 337 | } |
| 338 | |
| 339 | func makeVersionedPluginDir(t *testing.T, id string, versions ...string) (string, map[string]string) { |
| 340 | t.Helper() |
no test coverage detected