MCPcopy
hub / github.com/helm/helm / TestInstallCRDs_CheckNilErrors

Function TestInstallCRDs_CheckNilErrors

pkg/action/install_test.go:1240–1277  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1238}
1239
1240func TestInstallCRDs_CheckNilErrors(t *testing.T) {
1241 tests := []struct {
1242 name string
1243 input []chart.CRD
1244 }{
1245 {
1246 name: "only one crd with file nil",
1247 input: []chart.CRD{
1248 {Name: "one", File: nil},
1249 },
1250 },
1251 {
1252 name: "only one crd with its file data nil",
1253 input: []chart.CRD{
1254 {Name: "one", File: &common.File{Name: "crds/foo.yaml", Data: nil}},
1255 },
1256 },
1257 {
1258 name: "at least a crd with its file data nil",
1259 input: []chart.CRD{
1260 {Name: "one", File: &common.File{Name: "crds/foo.yaml", Data: []byte("data")}},
1261 {Name: "two", File: &common.File{Name: "crds/foo2.yaml", Data: nil}},
1262 {Name: "three", File: &common.File{Name: "crds/foo3.yaml", Data: []byte("data")}},
1263 },
1264 },
1265 }
1266
1267 for _, tt := range tests {
1268 t.Run(tt.name, func(t *testing.T) {
1269 instAction := installAction(t)
1270
1271 err := instAction.installCRDs(tt.input)
1272 if err == nil {
1273 t.Error("got nil expected err")
1274 }
1275 })
1276 }
1277}
1278
1279func TestInstallRelease_WaitOptionsPassedDownstream(t *testing.T) {
1280 is := assert.New(t)

Callers

nothing calls this directly

Calls 4

installActionFunction · 0.85
installCRDsMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…