Skip to content

Commit

Permalink
refactor: refactor reconcile test case
Browse files Browse the repository at this point in the history
Signed-off-by: Phoeniix Zhao <[email protected]>
  • Loading branch information
Phoenix500526 committed Jan 14, 2024
1 parent 0f4014a commit d479421
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/reconciler/reconcile_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (r *ReconcileContext) CreateOrUpdate(obj client.Object, objType client.Obje
r.Log.Info("create object: " + util.K8sObjKeyStr(key))
return nil
} else {
r.Log.Info("update object: " + util.K8sObjKeyStr(key))
return r.Update(r.Ctx, obj)
}
}
Expand Down
3 changes: 1 addition & 2 deletions internal/reconciler/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestStatusConvert(t *testing.T) {
res := sucStage.AsXlineClusterRecStatus()
assert.Equal(t, res.Stage, xapi.StageXlineService)
assert.Equal(t, res.StageStatus, xapi.StageResultSucceeded)
assert.True(t, res.LastMessage == "")
assert.Equal(t, res.LastMessage, "")
})

t.Run("Failed Status can covert to XlineClusterRecStatus properly", func(t *testing.T) {
Expand All @@ -25,5 +25,4 @@ func TestStatusConvert(t *testing.T) {
assert.Equal(t, res.StageStatus, xapi.StageResultFailed)
assert.Equal(t, res.LastMessage, "failed to create service")
})

}

0 comments on commit d479421

Please sign in to comment.