From ba147e484b68f5254b0d68ca04b73d9b907e1408 Mon Sep 17 00:00:00 2001 From: dodo2d <1721933298@qq.com> Date: Mon, 2 Jun 2025 20:53:50 +0800 Subject: [PATCH] Add Notation to TestGetWorkerDaemonsetName in pkg\ddc\alluxio\utils_test.go. Signed-off-by: dodo2d <1721933298@qq.com> --- pkg/ddc/alluxio/utils_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/ddc/alluxio/utils_test.go b/pkg/ddc/alluxio/utils_test.go index 6bccbbb4223..4e33ee48aa4 100644 --- a/pkg/ddc/alluxio/utils_test.go +++ b/pkg/ddc/alluxio/utils_test.go @@ -772,6 +772,16 @@ func TestGetMasterStatefulsetName(t *testing.T) { } } +// TestGetWorkerDaemonsetName is a unit test for the getWorkerName method of the AlluxioEngine struct. +// This test verifies that the method correctly constructs the expected worker daemonset name +// based on the given engine name. +// The test defines a struct `fields` containing the engine name and a test case struct +// that includes the test case name, input fields, and the expected daemonset name. +// The test case used: +// - When the engine name is "spark", the expected daemonset name should be "spark-worker". +// The test iterates through all defined cases, creates an instance of AlluxioEngine with +// the given name, calls the `getWorkerName` method, and checks if the returned result matches +// the expected value. If the result differs, an error message is reported. func TestGetWorkerDaemonsetName(t *testing.T) { type fields struct { name string