MCPcopy
hub / github.com/helm/helm / mockSubprocessCLIPlugin

Function mockSubprocessCLIPlugin

internal/plugin/plugin_test.go:62–100  ·  view source on GitHub ↗
(t *testing.T, pluginName string)

Source from the content-addressed store, hash-verified

60}
61
62func mockSubprocessCLIPlugin(t *testing.T, pluginName string) *SubprocessPluginRuntime {
63 t.Helper()
64
65 rc := RuntimeConfigSubprocess{
66 PlatformCommand: []PlatformCommand{
67 {OperatingSystem: "darwin", Architecture: "", Command: "sh", Args: []string{"-c", "echo \"mock plugin\""}},
68 {OperatingSystem: "linux", Architecture: "", Command: "sh", Args: []string{"-c", "echo \"mock plugin\""}},
69 {OperatingSystem: "windows", Architecture: "", Command: "pwsh", Args: []string{"-c", "echo \"mock plugin\""}},
70 },
71 PlatformHooks: map[string][]PlatformCommand{
72 Install: {
73 {OperatingSystem: "darwin", Architecture: "", Command: "sh", Args: []string{"-c", "echo \"installing...\""}},
74 {OperatingSystem: "linux", Architecture: "", Command: "sh", Args: []string{"-c", "echo \"installing...\""}},
75 {OperatingSystem: "windows", Architecture: "", Command: "pwsh", Args: []string{"-c", "echo \"installing...\""}},
76 },
77 },
78 }
79
80 pluginDir := t.TempDir()
81
82 return &SubprocessPluginRuntime{
83 metadata: Metadata{
84 Name: pluginName,
85 Version: "0.1.2",
86 Type: "cli/v1",
87 APIVersion: "v1",
88 Runtime: "subprocess",
89 Config: &schema.ConfigCLIV1{
90 Usage: "Mock plugin",
91 ShortHelp: "Mock plugin",
92 LongHelp: "Mock plugin for testing",
93 IgnoreFlags: false,
94 },
95 RuntimeConfig: &rc,
96 },
97 pluginDir: pluginDir, // NOTE: dir is empty (ie. plugin.yaml is not present)
98 RuntimeConfig: rc,
99 }
100}

Callers 3

TestDetectDuplicatesFunction · 0.85
TestValidatePluginDataFunction · 0.85

Calls 1

HelperMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…