Skip to content

Commit 6df275c

Browse files
Add comments to newTestJindoEngine in pkg/ddc/jindo/delete_volume_test.go.
Signed-off-by: Zhangggggggggg <1253360905@qq.com>
1 parent f25c163 commit 6df275c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

pkg/ddc/jindo/delete_volume_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ type TestCase struct {
3838
isErr bool
3939
}
4040

41+
// newTestJindoEngine creates a mock JindoEngine instance for testing purposes.
42+
// This helper function is used to simulate JindoEngine behavior under different runtime conditions.
43+
// It accepts a Kubernetes client, a runtime name and namespace, and a boolean flag indicating whether
44+
// to initialize the engine with a runtime.
45+
//
46+
// Parameters:
47+
// - client: a fake or real Kubernetes client used by the engine to interact with cluster resources.
48+
// - name: the name of the JindoRuntime, used to build runtime metadata.
49+
// - namespace: the namespace of the JindoRuntime.
50+
// - withRunTime: if true, the engine will be initialized with a valid JindoRuntime and runtimeInfo;
51+
// if false, the runtime and runtimeInfo will be set to nil, simulating a missing runtime.
52+
//
53+
// Returns:
54+
// - A pointer to the initialized JindoEngine instance, ready for use in unit tests.
4155
func newTestJindoEngine(client client.Client, name string, namespace string, withRunTime bool) *JindoEngine {
4256
runTime := &datav1alpha1.JindoRuntime{}
4357
runTimeInfo, _ := base.BuildRuntimeInfo(name, namespace, common.JindoRuntime)

0 commit comments

Comments
 (0)