MCPcopy
hub / github.com/helm/helm / buildLoadExtismPlugin

Function buildLoadExtismPlugin

internal/plugin/runtime_extismv1_test.go:37–58  ·  view source on GitHub ↗
(t *testing.T, dir string)

Source from the content-addressed store, hash-verified

35}
36
37func buildLoadExtismPlugin(t *testing.T, dir string) pluginRaw {
38 t.Helper()
39
40 pluginFile := filepath.Join(dir, PluginFileName)
41
42 metadataData, err := os.ReadFile(pluginFile)
43 require.NoError(t, err)
44
45 m, err := loadMetadata(metadataData)
46 require.NoError(t, err)
47 require.Equal(t, "extism/v1", m.Runtime, "expected plugin runtime to be extism/v1")
48
49 cmd := exec.Command("make", "-C", dir)
50 cmd.Stdout = os.Stdout
51 cmd.Stderr = os.Stderr
52 require.NoError(t, cmd.Run(), "failed to build plugin in %q", dir)
53
54 return pluginRaw{
55 Metadata: *m,
56 Dir: dir,
57 }
58}
59
60func TestRuntimeConfigExtismV1Validate(t *testing.T) {
61 rc := RuntimeConfigExtismV1{}

Callers 1

Calls 3

loadMetadataFunction · 0.85
HelperMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…