|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|
|
|
|
package action
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
//"fmt"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -77,7 +78,7 @@ func TestLintChart(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
for _, tt := range tests {
|
|
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
|
|
_, err := lintChart(tt.chartPath, map[string]interface{}{}, namespace, nil)
|
|
|
|
|
_, err := lintChart(tt.chartPath, map[string]interface{}{}, namespace, nil, true)
|
|
|
|
|
switch {
|
|
|
|
|
case err != nil && !tt.err:
|
|
|
|
|
t.Errorf("%s", err)
|
|
|
|
@ -157,3 +158,17 @@ func TestLint_ChartWithWarnings(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestLint_ChartWithInfo(t *testing.T) {
|
|
|
|
|
t.Run("should pass with no INFO messages when quiet", func(t *testing.T) {
|
|
|
|
|
testCharts := []string{chart1MultipleChartLint}
|
|
|
|
|
testLint := NewLint()
|
|
|
|
|
testLint.Quiet = true
|
|
|
|
|
result := testLint.Run(testCharts, values)
|
|
|
|
|
for _, message := range result.Messages {
|
|
|
|
|
if message.Severity < 3 {
|
|
|
|
|
t.Error("expected no INFO(1) or UNKNOWN(0) messages, but got \nSeverity:", message.Severity, "\nError:", message.Err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|