|
|
|
@ -38,12 +38,12 @@ const goodChartDir = "rules/testdata/goodone"
|
|
|
|
|
|
|
|
|
|
func TestBadChart(t *testing.T) {
|
|
|
|
|
m := All(badChartDir, values, namespace, strict).Messages
|
|
|
|
|
if len(m) != 8 {
|
|
|
|
|
if len(m) != 9 {
|
|
|
|
|
t.Errorf("Number of errors %v", len(m))
|
|
|
|
|
t.Errorf("All didn't fail with expected errors, got %#v", m)
|
|
|
|
|
}
|
|
|
|
|
// There should be one INFO, 2 WARNINGs and 2 ERROR messages, check for them
|
|
|
|
|
var i, w, e, e2, e3, e4, e5, e6 bool
|
|
|
|
|
// There should be one INFO, 2 WARNINGs and 6 ERROR messages, check for them
|
|
|
|
|
var i, w, w2, e, e2, e3, e4, e5, e6 bool
|
|
|
|
|
for _, msg := range m {
|
|
|
|
|
if msg.Severity == support.InfoSev {
|
|
|
|
|
if strings.Contains(msg.Err.Error(), "icon is recommended") {
|
|
|
|
@ -54,6 +54,9 @@ func TestBadChart(t *testing.T) {
|
|
|
|
|
if strings.Contains(msg.Err.Error(), "directory not found") {
|
|
|
|
|
w = true
|
|
|
|
|
}
|
|
|
|
|
if strings.Contains(msg.Err.Error(), "directory not found") {
|
|
|
|
|
w2 = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if msg.Severity == support.ErrorSev {
|
|
|
|
|
if strings.Contains(msg.Err.Error(), "version '0.0.0.0' is not a valid SemVer") {
|
|
|
|
@ -80,7 +83,7 @@ func TestBadChart(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if !e || !e2 || !e3 || !e4 || !e5 || !w || !i || !e6 {
|
|
|
|
|
if !e || !e2 || !e3 || !e4 || !e5 || !w || !w2 || !i || !e6 {
|
|
|
|
|
t.Errorf("Didn't find all the expected errors, got %#v", m)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|