MCPcopy Create free account
hub / github.com/Azure/draft / TestInvalidChartAndValues

Function TestInvalidChartAndValues

pkg/safeguards/preprocessing/preprocessing_test.go:124–136  ·  view source on GitHub ↗

** * Testing user errors */ Should fail if the Chart.yaml is invalid

(t *testing.T)

Source from the content-addressed store, hash-verified

122
123// Should fail if the Chart.yaml is invalid
124func TestInvalidChartAndValues(t *testing.T) {
125 var opt chartutil.ReleaseOptions
126
127 _, err := RenderHelmChart(false, consts.InvalidChartPath, opt)
128 assert.NotNil(t, err)
129 assert.Contains(t, err.Error(), "failed to load main chart: validation: chart.metadata.name is required")
130
131 _, err = RenderHelmChart(false, consts.InvalidValuesChart, opt)
132 assert.NotNil(t, err)
133
134 _, err = RenderHelmChart(false, consts.DirectPath_ToInvalidChart, opt)
135 assert.NotNil(t, err)
136}
137
138// Testing with malformed Deployment.yaml
139func TestInvalidDeployments(t *testing.T) {

Callers

nothing calls this directly

Calls 2

RenderHelmChartFunction · 0.85
ContainsMethod · 0.80

Tested by

no test coverage detected