fix-review

This commit is contained in:
zhangxiaoyu-zidif 2017-08-12 13:31:08 +08:00
parent ae4fac416d
commit db2e7cd69a

View File

@ -46,7 +46,7 @@ func TestStatefulSetControllerCreates(t *testing.T) {
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
if set.Status.Replicas != 3 { if set.Status.Replicas != 3 {
t.Error("Falied to scale statefulset to 3 replicas") t.Errorf("set.Status.Replicas = %v; want 3", set.Status.Replicas)
} }
} }
@ -62,7 +62,7 @@ func TestStatefulSetControllerDeletes(t *testing.T) {
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
if set.Status.Replicas != 3 { if set.Status.Replicas != 3 {
t.Error("Falied to scale statefulset to 3 replicas") t.Errorf("set.Status.Replicas = %v; want 3", set.Status.Replicas)
} }
*set.Spec.Replicas = 0 *set.Spec.Replicas = 0
if err := scaleDownStatefulSetController(set, ssc, spc); err != nil { if err := scaleDownStatefulSetController(set, ssc, spc); err != nil {
@ -74,7 +74,7 @@ func TestStatefulSetControllerDeletes(t *testing.T) {
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
if set.Status.Replicas != 0 { if set.Status.Replicas != 0 {
t.Error("Falied to scale statefulset to 3 replicas") t.Errorf("set.Status.Replicas = %v; want 0", set.Status.Replicas)
} }
} }
@ -90,7 +90,7 @@ func TestStatefulSetControllerRespectsTermination(t *testing.T) {
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
if set.Status.Replicas != 3 { if set.Status.Replicas != 3 {
t.Error("Falied to scale statefulset to 3 replicas") t.Errorf("set.Status.Replicas = %v; want 3", set.Status.Replicas)
} }
pods, err := spc.addTerminatingPod(set, 3) pods, err := spc.addTerminatingPod(set, 3)
if err != nil { if err != nil {
@ -125,7 +125,7 @@ func TestStatefulSetControllerRespectsTermination(t *testing.T) {
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
if set.Status.Replicas != 0 { if set.Status.Replicas != 0 {
t.Error("Falied to scale statefulset to 3 replicas") t.Errorf("set.Status.Replicas = %v; want 0", set.Status.Replicas)
} }
} }
@ -141,7 +141,7 @@ func TestStatefulSetControllerBlocksScaling(t *testing.T) {
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
if set.Status.Replicas != 3 { if set.Status.Replicas != 3 {
t.Error("Falied to scale statefulset to 3 replicas") t.Errorf("set.Status.Replicas = %v; want 3", set.Status.Replicas)
} }
*set.Spec.Replicas = 5 *set.Spec.Replicas = 5
fakeResourceVersion(set) fakeResourceVersion(set)