Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Mar 4, 2024
1 parent c10e38c commit 15025ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions azure/services/agentpools/agentpools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestPostCreateOrUpdateResourceHook(t *testing.T) {
scope := mock_agentpools.NewMockAgentPoolScope(mockCtrl)

scope.EXPECT().RemoveCAPIMachinePoolAnnotation(clusterv1.ReplicasManagedByAnnotation)
scope.EXPECT().IsPreviewEnabled().Return(false)

managedCluster := &asocontainerservicev1.ManagedClustersAgentPool{
Status: asocontainerservicev1.ManagedClusters_AgentPool_STATUS{
Expand All @@ -64,6 +65,7 @@ func TestPostCreateOrUpdateResourceHook(t *testing.T) {

scope.EXPECT().SetCAPIMachinePoolAnnotation(clusterv1.ReplicasManagedByAnnotation, "true")
scope.EXPECT().SetCAPIMachinePoolReplicas(ptr.To(1234))
scope.EXPECT().IsPreviewEnabled().Return(false)

managedCluster := &asocontainerservicev1.ManagedClustersAgentPool{
Status: asocontainerservicev1.ManagedClusters_AgentPool_STATUS{
Expand Down
1 change: 1 addition & 0 deletions controllers/azuremanagedmachinepool_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func TestAzureManagedMachinePoolReconcile(t *testing.T) {
agentpools.SetAgentPoolProviderIDList(providerIDs)
agentpools.SetAgentPoolReplicas(int32(len(providerIDs))).Return()
agentpools.SetAgentPoolReady(true).Return()
agentpools.IsPreviewEnabled().Return(false)

nodelister.List(gomock2.AContext(), "fake-rg").Return(fakeVirtualMachineScaleSet, nil)
nodelister.ListInstances(gomock2.AContext(), "fake-rg", "vmssName").Return(fakeVirtualMachineScaleSetVM, nil)
Expand Down

0 comments on commit 15025ef

Please sign in to comment.