Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Fix preflight checker tests #591

Merged
merged 1 commit into from
Apr 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pkg/preflight/checkers/checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (

"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/weaveworks/ignite/pkg/preflight"
)

type fakeChecker struct {
Expand All @@ -23,24 +25,28 @@ func (fc fakeChecker) Name() string {
return "FakeChecker"
}

func (fc fakeChecker) Type() string {
return "FakeChecker"
}

func TestRunChecks(t *testing.T) {
utests := []struct {
checkers []Checker
checkers []preflight.Checker
ignoredErrors []string
expectedError bool
}{
{
checkers: []Checker{fakeChecker{info: ""}},
checkers: []preflight.Checker{fakeChecker{info: ""}},
ignoredErrors: []string{},
expectedError: false,
},
{
checkers: []Checker{fakeChecker{info: ""}, fakeChecker{info: "error"}},
checkers: []preflight.Checker{fakeChecker{info: ""}, fakeChecker{info: "error"}},
ignoredErrors: []string{},
expectedError: true,
},
{
checkers: []Checker{fakeChecker{info: ""}, fakeChecker{info: "error"}},
checkers: []preflight.Checker{fakeChecker{info: ""}, fakeChecker{info: "error"}},
ignoredErrors: []string{"fakechecker"},
expectedError: false,
},
Expand Down