Skip to content

Commit

Permalink
changes made to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-kun committed Oct 3, 2023
1 parent c295f7c commit 3260bbf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cluster-autoscaler/cloudprovider/mcm/mcm_cloud_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ func TestRefresh(t *testing.T) {

// Different kinds of cases possible and expected cloudprovider.Instance returned for them
// (mobj, mobjPid, nodeobj) -> instance(nodeobj.pid,_)
// (mobj, mobjPid, _) -> instance("requested://<machine-name>",status{'creating'})
// (mobj, _,_) -> instance("requested://<machine-name>",status{'creating'})
// (mobj, mobjPid, _) -> instance("requested://<machine-name>",_)
// (mobj, _,_) -> instance("requested://<machine-name>",_)
// (mobj, _,_) with quota error -> instance("requested://<machine-name>",status{'creating',{'outofResourcesClass','ResourceExhausted','<message>'}})
// (mobj, _,_) with invalid credentials error -> instance("requested://<machine-name>",status{'creating'})
// (mobj, _,_) with invalid credentials error -> instance("requested://<machine-name>",_)

// Example machine.status.lastOperation for a `ResourceExhausted` error
//
Expand Down Expand Up @@ -477,11 +477,11 @@ func TestNodes(t *testing.T) {
expect{
expectationPerInstanceList: []expectationPerInstance{
{"fakeID-1", cloudprovider.InstanceState(-1), cloudprovider.InstanceErrorClass(-1), "", ""},
{placeholderInstanceIDForMachineObj("machine-with-vm-but-no-node"), cloudprovider.InstanceCreating, cloudprovider.InstanceErrorClass(-1), "", ""},
{placeholderInstanceIDForMachineObj("machine-with-vm-creating"), cloudprovider.InstanceCreating, cloudprovider.InstanceErrorClass(-1), "", ""},
{placeholderInstanceIDForMachineObj("machine-with-vm-but-no-node"), cloudprovider.InstanceState(-1), cloudprovider.InstanceErrorClass(-1), "", ""},
{placeholderInstanceIDForMachineObj("machine-with-vm-creating"), cloudprovider.InstanceState(-1), cloudprovider.InstanceErrorClass(-1), "", ""},
{placeholderInstanceIDForMachineObj("machine-with-vm-create-error-out-of-quota"), cloudprovider.InstanceCreating, cloudprovider.OutOfResourcesErrorClass, machinecodes.ResourceExhausted.String(), outOfQuotaInstanceErrorMessage},
// invalid credentials error is mapped to Internal code as it can't be fixed by trying another zone
{placeholderInstanceIDForMachineObj("machine-with-vm-create-error-invalid-credentials"), cloudprovider.InstanceCreating, cloudprovider.InstanceErrorClass(-1), "", ""},
{placeholderInstanceIDForMachineObj("machine-with-vm-create-error-invalid-credentials"), cloudprovider.InstanceState(-1), cloudprovider.InstanceErrorClass(-1), "", ""},
},
},
},
Expand Down

0 comments on commit 3260bbf

Please sign in to comment.