MCPcopy Index your code
hub / github.com/devspace-sh/devspace / TestHookWithExecution

Function TestHookWithExecution

pkg/devspace/hook/hook_test.go:65–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestHookWithExecution(t *testing.T) {
66 conf := config.NewConfig(map[string]interface{}{},
67 map[string]interface{}{},
68 &latest.Config{
69 Hooks: []*latest.HookConfig{{
70 Events: []string{"my-event"},
71 Command: "echo",
72 Args: []string{"hello"},
73 }},
74 },
75 localcache.New(constants.DefaultCacheFolder),
76 &remotecache.RemoteCache{},
77 map[string]interface{}{},
78 constants.DefaultConfigPath)
79
80 err := ExecuteHooks(devspacecontext.NewContext(context.Background(), nil, log.Discard).WithConfig(conf), nil)
81 if err != nil {
82 t.Fatalf("Failed to execute 1 hook with empty When.After: %v", err)
83 }
84}

Callers

nothing calls this directly

Calls 5

NewConfigFunction · 0.92
NewFunction · 0.92
ExecuteHooksFunction · 0.85
WithConfigMethod · 0.65
FatalfMethod · 0.45

Tested by

no test coverage detected