Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kim Christensen <kimworking@gmail.com>
  • Loading branch information
kichristensen committed Apr 1, 2024
1 parent c04aef3 commit 0c1a5e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions controllers/agentconfig_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func TestAgentConfigReconciler_Reconcile(t *testing.T) {
pvc.Finalizers = append(pvc.Finalizers, "kubernetes.io/pvc-protection")
require.NoError(t, controller.Create(ctx, pvc))

triggerReconcile()
triggerReconcile() // TODO: Here is the PVC later renamed created

// Verify that the agent config status was synced with the action
var actionList porterv1.AgentAction
Expand Down Expand Up @@ -296,8 +296,9 @@ func TestAgentConfigReconciler_Reconcile(t *testing.T) {

// the renamed pvc should eventually be bounded the to pv
renamedPVC.Spec.VolumeName = pv.Name
renamedPVC.Status.Phase = corev1.ClaimBound
require.NoError(t, controller.Update(ctx, renamedPVC))
renamedPVC.Status.Phase = corev1.ClaimBound
require.NoError(t, controller.Status().Update(ctx, renamedPVC))

triggerReconcile()
require.True(t, agentCfg.Status.Ready)
Expand Down Expand Up @@ -640,8 +641,9 @@ func TestAgentConfigReconciler_AgentConfigUpdates(t *testing.T) {

// the renamed pvc should eventually be bounded the to pv
renamedPVC.Spec.VolumeName = pv2.Name
renamedPVC.Status.Phase = corev1.ClaimBound
require.NoError(t, controller.Update(ctx, renamedPVC))
renamedPVC.Status.Phase = corev1.ClaimBound
require.NoError(t, controller.Status().Update(ctx, renamedPVC))

triggerReconcile()
require.True(t, agentCfg.Status.Ready)
Expand Down

0 comments on commit 0c1a5e0

Please sign in to comment.