MCPcopy
hub / github.com/helm/helm / createTestPluginTarball

Function createTestPluginTarball

pkg/cmd/plugin_verify_test.go:193–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func createTestPluginTarball(t *testing.T) string {
194 t.Helper()
195
196 pluginDir := createTestPluginDir(t)
197
198 // Create tarball using the plugin package helper
199 tmpDir := filepath.Dir(pluginDir)
200 tgzPath := filepath.Join(tmpDir, "test-plugin-1.0.0.tgz")
201 tarFile, err := os.Create(tgzPath)
202 if err != nil {
203 t.Fatalf("Failed to create tarball file: %v", err)
204 }
205 defer tarFile.Close()
206
207 if err := plugin.CreatePluginTarball(pluginDir, "test-plugin", tarFile); err != nil {
208 t.Fatalf("Failed to create tarball: %v", err)
209 }
210
211 return tgzPath
212}
213
214func createProvFile(t *testing.T, provFile, pluginTgz, hash string) {
215 t.Helper()

Calls 7

CreatePluginTarballFunction · 0.92
HelperMethod · 0.80
FatalfMethod · 0.80
CloseMethod · 0.80
createTestPluginDirFunction · 0.70
DirMethod · 0.65
CreateMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…