linter fixes

pull/2585/head
Wil Reichert 8 years ago
parent c649659631
commit 54888f1421

@ -86,8 +86,8 @@ func TestBadValues(t *testing.T) {
}
func TestGoodChart(t *testing.T) {
m := All(goodChartDir).Messages
if len(m) != 0 {
t.Errorf("All failed but shouldn't have: %#v", m)
sev := All(goodChartDir).HighestSeverity
if sev > support.WarningSev {
t.Errorf("All failed but shouldn't have: %#v", sev)
}
}

@ -133,9 +133,9 @@ func Templates(linter *support.Linter) {
// if kubernetes server is unavailable print a warning
// and don't try again this run.
timeout := time.Duration(5 * time.Second)
_, err = net.DialTimeout("tcp" , u.Host , timeout)
_, err = net.DialTimeout("tcp", u.Host, timeout)
if err != nil {
e := fmt.Errorf("%s, skipping schema validation\n", err)
e := fmt.Errorf("skipping schema validation\n\t%s", err)
linter.RunLinterRule(support.WarningSev, path, e)
serverAvailable = false
continue

@ -72,8 +72,12 @@ func TestTemplateIntegrationHappyPath(t *testing.T) {
Templates(&linter)
res := linter.Messages
// expect no errors and one warning indicating no server is available
if len(res) != 1 && linter.Messages[0].Severity != support.WarningSev {
t.Fatalf("Expected one warning and no error, got %d, %v", len(res), res)
// expect one warning indicating no server is available
if len(res) != 1 {
t.Fatalf("expected one warning, got %d, %v", len(res), res)
}
if linter.HighestSeverity != support.WarningSev {
t.Fatalf("expected warning severity, got %d, %v", linter.HighestSeverity, res)
}
}

Loading…
Cancel
Save