(t *testing.T)
| 378 | } |
| 379 | |
| 380 | func TestStatefulSetScaleFailsPreconditions(t *testing.T) { |
| 381 | scaleClientExpectedAction := []string{"get"} |
| 382 | scaleClient := createFakeScaleClient("statefulsets", "foo", 10, nil) |
| 383 | scaler := NewScaler(scaleClient) |
| 384 | preconditions := ScalePrecondition{2, ""} |
| 385 | count := uint(3) |
| 386 | name := "foo" |
| 387 | err := scaler.Scale("default", name, count, nil, &preconditions, nil, nil, stsgvr, false) |
| 388 | if err == nil { |
| 389 | t.Fatal("expected to get an error but none was returned") |
| 390 | } |
| 391 | actions := scaleClient.Actions() |
| 392 | if len(actions) != len(scaleClientExpectedAction) { |
| 393 | t.Errorf("unexpected actions: %v, expected %d actions got %d", actions, len(scaleClientExpectedAction), len(actions)) |
| 394 | } |
| 395 | for i, verb := range scaleClientExpectedAction { |
| 396 | if actions[i].GetVerb() != verb { |
| 397 | t.Errorf("unexpected action: %+v, expected %s", actions[i].GetVerb(), verb) |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func TestReplicaSetScale(t *testing.T) { |
| 403 | scaleClientExpectedAction := []string{"patch"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…