From 6e73e3fe1733be6672826520f23106c6e40d3a04 Mon Sep 17 00:00:00 2001 From: dr0chen <2260522510@qq.com> Date: Mon, 10 Mar 2025 18:08:12 +0800 Subject: [PATCH] Add Comments to TestGetRuntimeInfo in pkg/ddc/jindo/runtime_infotest.go. Signed-off-by: dr0chen <2260522510@qq.com> --- pkg/ddc/jindo/runtime_info_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/ddc/jindo/runtime_info_test.go b/pkg/ddc/jindo/runtime_info_test.go index 40b3e37a264..91da3b01be4 100644 --- a/pkg/ddc/jindo/runtime_info_test.go +++ b/pkg/ddc/jindo/runtime_info_test.go @@ -44,6 +44,14 @@ func newJindoEngineRT(client client.Client, name string, namespace string, withR return engine } +// TestGetRuntimeInfo tests the jindoEngine's getRuntimeInfo method under various scenarios. +// It validates the correct retrieval of runtime information from both existing and non-existing configurations, +// including error handling and nil return checks. Test cases cover: +// - Multiple JindoRuntime instances (hbase, hadoop) in the "fluid" namespace +// - Presence/Absence of runtime information (controlled by withRuntimeInfo flag) +// - Associated DaemonSets and Dataset configurations +// The test uses a fake Kubernetes client with preloaded JindoRuntimes, DaemonSets, and Datasets +// to simulate cluster state and verify expected behaviors. func TestGetRuntimeInfo(t *testing.T) { runtimeInputs := []*datav1alpha1.JindoRuntime{ {