Helper functions for test setup
(t *testing.T)
| 173 | // Helper functions for test setup |
| 174 | |
| 175 | func createTestPluginDir(t *testing.T) string { |
| 176 | t.Helper() |
| 177 | |
| 178 | // Create temporary directory with plugin structure |
| 179 | tmpDir := t.TempDir() |
| 180 | pluginDir := filepath.Join(tmpDir, "test-plugin") |
| 181 | if err := os.MkdirAll(pluginDir, 0755); err != nil { |
| 182 | t.Fatalf("Failed to create plugin directory: %v", err) |
| 183 | } |
| 184 | |
| 185 | // Use the same plugin YAML as other cmd tests |
| 186 | if err := os.WriteFile(filepath.Join(pluginDir, "plugin.yaml"), []byte(testPluginYAML), 0644); err != nil { |
| 187 | t.Fatalf("Failed to create plugin.yaml: %v", err) |
| 188 | } |
| 189 | |
| 190 | return pluginDir |
| 191 | } |
| 192 | |
| 193 | func createTestPluginTarball(t *testing.T) string { |
| 194 | t.Helper() |
no test coverage detected
searching dependent graphs…