MCPcopy
hub / github.com/helm/helm / createTestPluginDir

Function createTestPluginDir

pkg/cmd/plugin_verify_test.go:175–191  ·  view source on GitHub ↗

Helper functions for test setup

(t *testing.T)

Source from the content-addressed store, hash-verified

173// Helper functions for test setup
174
175func 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
193func createTestPluginTarball(t *testing.T) string {
194 t.Helper()

Calls 3

HelperMethod · 0.80
FatalfMethod · 0.80
WriteFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…