Update unit tests

pull/8868/head
Thomas Stromberg 2020-07-29 14:08:48 -07:00
parent 59d0d7335a
commit c6e6013d40
2 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,8 @@ import (
)
func TestPrintStep(t *testing.T) {
Reg.SetStep(InitialSetup)
expected := `{"data":{"currentstep":"0","message":"message","name":"Initial Minikube Setup","totalsteps":"%v"},"datacontenttype":"application/json","id":"random-id","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"}`
expected = fmt.Sprintf(expected, Reg.totalSteps())
expected += "\n"
@ -36,7 +38,6 @@ func TestPrintStep(t *testing.T) {
return "random-id"
}
Reg.SetStep(InitialSetup)
PrintStep("message")
actual := buf.String()

View File

@ -110,7 +110,8 @@ func (r *Register) currentStep() string {
// all steps should be registered so this shouldn't happen
// can't call exit.WithError as it creates an import dependency loop
panic(fmt.Sprintf("%q is in the expected steps for %q: %v", r.current, r.first, steps))
glog.Errorf("%q was not found within the registered steps for %q: %v", r.current, r.first, steps)
return ""
}
// SetStep sets the current step