From 8c3287401f25ca13dff8c73c1b4c39294149b98c Mon Sep 17 00:00:00 2001 From: ShallowDream121 <1198756374@qq.com> Date: Fri, 7 Mar 2025 11:47:31 +0800 Subject: [PATCH] Add Notation to TestAlluxioEngine_DeleteVolume in pkg/ddc/alluxio/delete_volume_test.go Signed-off-by: ShallowDream121 <1198756374@qq.com> --- pkg/ddc/alluxio/delete_volume_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/ddc/alluxio/delete_volume_test.go b/pkg/ddc/alluxio/delete_volume_test.go index c2293a1fcf3..e02e5890e1f 100644 --- a/pkg/ddc/alluxio/delete_volume_test.go +++ b/pkg/ddc/alluxio/delete_volume_test.go @@ -75,6 +75,14 @@ func doTestCases(testCases []TestCase, t *testing.T) { } } +// TestAlluxioEngine_DeleteVolume tests the DeleteVolume function of the AlluxioEngine. +// It sets up test cases with different PersistentVolume (PV) and PersistentVolumeClaim (PVC) inputs, +// including scenarios with and without errors. The function uses a fake Kubernetes client to simulate +// the behavior of the AlluxioEngine when deleting volumes. The test cases include: +// 1. A common scenario where the volume should be deleted without errors. +// 2. A scenario where an error is expected due to specific annotations on the PVC. +// 3. A scenario where an error is expected because the AlluxioEngine is not running. +// The function then runs these test cases using the doTestCases helper function to verify the expected outcomes. func TestAlluxioEngine_DeleteVolume(t *testing.T) { testPVInputs := []*v1.PersistentVolume{ {