MCPcopy
hub / github.com/helm/helm / TestRootCmdLogger

Function TestRootCmdLogger

pkg/cmd/root_test.go:136–151  ·  view source on GitHub ↗

Need the release of Cobra following 1.0 to be able to disable file completion on the root command. Until then, we cannot because it would break 'helm help ' func TestRootFileCompletion(t *testing.T) { checkFileCompletion(t, "", false) }

(t *testing.T)

Source from the content-addressed store, hash-verified

134// }
135
136func TestRootCmdLogger(t *testing.T) {
137 args := []string{}
138 buf := new(bytes.Buffer)
139 actionConfig := action.NewConfiguration()
140 _, err := newRootCmdWithConfig(actionConfig, buf, args, SetupLogging)
141 if err != nil {
142 t.Errorf("expected no error, got: '%v'", err)
143 }
144
145 l1 := actionConfig.Logger()
146 l2 := slog.Default()
147
148 if l1.Handler() != l2.Handler() {
149 t.Error("expected actionConfig logger to be the slog default logger")
150 }
151}

Callers

nothing calls this directly

Calls 4

NewConfigurationFunction · 0.92
newRootCmdWithConfigFunction · 0.85
LoggerMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…