(t *testing.T)
| 287 | } |
| 288 | |
| 289 | func TestStatefulSetScale(t *testing.T) { |
| 290 | scaleClientExpectedAction := []string{"patch"} |
| 291 | scaleClient := createFakeScaleClient("statefulsets", "foo", 2, nil) |
| 292 | scaler := NewScaler(scaleClient) |
| 293 | count := uint(3) |
| 294 | name := "foo" |
| 295 | actualSize := new(int32) |
| 296 | err := scaler.Scale("default", name, count, actualSize, nil, nil, nil, stsgvr, false) |
| 297 | if err != nil { |
| 298 | t.Fatal(err) |
| 299 | } |
| 300 | if *actualSize != 3 { |
| 301 | t.Errorf("expected actualSize to be 3, got %d", *actualSize) |
| 302 | } |
| 303 | actions := scaleClient.Actions() |
| 304 | if len(actions) != len(scaleClientExpectedAction) { |
| 305 | t.Errorf("unexpected actions: %v, expected %d actions got %d", actions, len(scaleClientExpectedAction), len(actions)) |
| 306 | } |
| 307 | for i, verb := range scaleClientExpectedAction { |
| 308 | if actions[i].GetVerb() != verb { |
| 309 | t.Errorf("unexpected action: %+v, expected %s", actions[i].GetVerb(), verb) |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | func TestStatefulSetScaleRetry(t *testing.T) { |
| 315 | scaleClientExpectedAction := []string{"patch", "get"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…