Skip to content

Commit 95b7b7c

Browse files
committed
extra_modify_caused_by_make_fmt_in_all_repo
Signed-off-by: molihh <221220006@smail.nju.edu.cn>
1 parent 1a50b6a commit 95b7b7c

14 files changed

Lines changed: 63 additions & 70 deletions

pkg/ddc/alluxio/cache.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ func (e *AlluxioEngine) queryCacheStatus() (states cacheStates, err error) {
6868
// - When the Dataset's UfsTotal field is empty
6969
// - When the Dataset's UfsTotal field contains the metadata sync pending message
7070
// The cached percentage is calculated as (cached bytes / UfsTotal bytes) * 100.
71-
//
7271
// Parameters:
7372
// - dataset (v1alpha1.Dataset): Pointer to the Dataset object containing UFS metadata.
7473
// The Status.UfsTotal field must be a valid human-readable size string (e.g. "10GiB")
7574
// - states (cacheStates): Pointer to the cache state structure that will be modified in-place.
7675
// The cached field must be a valid human-readable size string (e.g. "5GiB")
77-
//
7876
// Returns:
7977
// - None: Modifies the states.cachedPercentage field directly with formatted percentage string.
8078
// The percentage is stored as a string using cachedPercentageFormat (e.g. "45.60%")

pkg/ddc/alluxio/load_data.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ func (e *AlluxioEngine) genDataLoadValue(image string, targetDataset *datav1alph
175175
// It obtains master pod details, creates file utilities, and checks readiness.
176176
//
177177
// Returns:
178-
//
179-
// ready bool - Runtime readiness status (true = ready, false = not ready).
178+
// ready bool - Runtime readiness status (true = ready, false = not ready).
180179
func (e *AlluxioEngine) CheckRuntimeReady() (ready bool) {
181180
podName, containerName := e.getMasterPodInfo()
182181
fileUtils := operations.NewAlluxioFileUtils(podName, containerName, e.namespace, e.Log)

pkg/ddc/alluxio/master_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ func TestCheckMasterReady(t *testing.T) {
168168
// Functionality: Verifies if the Alluxio master should be set up based on runtime status.
169169
// Parameters:
170170
// - t *testing.T: Standard testing object for test reporting and logging.
171-
//
172171
// Return: None (testing function).
173172
// Notes:
174173
// - Uses fake client to simulate interactions with Kubernetes API.

pkg/ddc/alluxio/transform_resources.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ func (e *AlluxioEngine) transformResourcesForMaster(runtime *datav1alpha1.Alluxi
4848
}
4949

5050
// transformResourcesForWorker is responsible for transforming and setting resource limits for the Alluxio Worker component.
51-
// This function updates the resource requirements for the Worker and JobWorker based on the runtime configuration
51+
// This function updates the resource requirements for the Worker and JobWorker based on the runtime configuration
5252
// and ensures that memory requests meet the required constraints.
5353
//
5454
// Parameters:
55-
// - runtime: *datav1alpha1.AlluxioRuntime, the runtime configuration of Alluxio, including resource definitions
56-
// for Worker and JobWorker.
55+
// - runtime: *datav1alpha1.AlluxioRuntime, the runtime configuration of Alluxio, including resource definitions
56+
// for Worker and JobWorker.
5757
// - value: *Alluxio, the Alluxio runtime instance used to store the transformed resource information.
58-
//
58+
//
5959
// Return value:
6060
// - error: Returns an error if any issue occurs during resource transformation; otherwise, returns nil.
6161
func (e *AlluxioEngine) transformResourcesForWorker(runtime *datav1alpha1.AlluxioRuntime, value *Alluxio) error {

pkg/ddc/alluxio/transform_resources_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,12 @@ func TestTransformResourcesForWorkerWithOnlyRequest(t *testing.T) {
458458
// resource requests are handled as expected.
459459
//
460460
// The function performs the following steps:
461-
// 1. Defines resource requirements with limits for memory (20Gi) and CPU (500m).
462-
// 2. Sets up test cases to validate the transformation logic, including scenarios with and without
463-
// tiered store configurations.
464-
// 3. Initializes an AlluxioEngine instance with a fake client and runtime objects for testing.
465-
// 4. Transforms the resource requirements for the worker using the AlluxioEngine.
466-
// 5. Validates the transformed resource limits and requests against the expected results.
461+
// 1. Defines resource requirements with limits for memory (20Gi) and CPU (500m).
462+
// 2. Sets up test cases to validate the transformation logic, including scenarios with and without
463+
// tiered store configurations.
464+
// 3. Initializes an AlluxioEngine instance with a fake client and runtime objects for testing.
465+
// 4. Transforms the resource requirements for the worker using the AlluxioEngine.
466+
// 5. Validates the transformed resource limits and requests against the expected results.
467467
//
468468
// Test cases include:
469469
// - A scenario where tiered store configuration is provided, ensuring memory limits and requests are set correctly.

pkg/ddc/alluxio/transform_test.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ func TestTransformMaster(t *testing.T) {
183183
}
184184
}
185185

186-
// TestTransformWorkers verifies that the transformWorkers function correctly transforms
187-
// the worker configuration of AlluxioRuntime into the expected Alluxio structure.
188-
// It tests different network modes, node selectors, and image pull secrets to ensure
186+
// TestTransformWorkers verifies that the transformWorkers function correctly transforms
187+
// the worker configuration of AlluxioRuntime into the expected Alluxio structure.
188+
// It tests different network modes, node selectors, and image pull secrets to ensure
189189
// correct transformation behavior.
190190
func TestTransformWorkers(t *testing.T) {
191191
testCases := map[string]struct {
@@ -588,21 +588,19 @@ func TestGetMediumTypeFromVolumeSource(t *testing.T) {
588588
}
589589
}
590590

591-
// TestAlluxioEngine_allocateSinglePort is a unit test function that tests
591+
// TestAlluxioEngine_allocateSinglePort is a unit test function that tests
592592
// the `allocateSinglePort` method of the `AlluxioEngine` struct.
593-
// The function verifies the behavior of port allocation for Alluxio master
593+
// The function verifies the behavior of port allocation for Alluxio master
594594
// and worker components under different scenarios,
595-
// including when properties are set, unset, or when runtime specifications
595+
// including when properties are set, unset, or when runtime specifications
596596
// are provided.
597-
//
597+
//
598598
// Parameters:
599599
// - t: A testing.T object provided by the Go testing framework, used to
600-
//
601600
// manage test state and support formatted test logs.
602601
//
603602
// Returns:
604603
// - None. The function is a test function and does not return any value.
605-
//
606604
// It reports test failures using the `t.Errorf` method.
607605
func TestAlluxioEngine_allocateSinglePort(t *testing.T) {
608606
// Define the fields required for the AlluxioEngine struct.
@@ -904,10 +902,10 @@ func TestAlluxioEngine_allocatePorts(t *testing.T) {
904902
//
905903
// Test Cases:
906904
// 1. "master properties is not null":
907-
// - Ensures that when master-specific properties exist, they override the global properties.
905+
// - Ensures that when master-specific properties exist, they override the global properties.
908906
//
909907
// 2. "properties is not null for master":
910-
// - Ensures that both master-specific and additional global properties are correctly handled.
908+
// - Ensures that both master-specific and additional global properties are correctly handled.
911909
//
912910
// The function iterates over multiple test cases and checks if the transformed properties
913911
// match the expected values. If the transformation does not produce the expected result, the test fails.

pkg/ddc/alluxio/transform_ufs_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323
v1 "k8s.io/api/core/v1"
2424
)
2525

26-
// TestTransformDatasetToVolume is a unit test function that verifies the transformation of a Dataset into a UFSPath
27-
// in the Alluxio runtime. It ensures that the Dataset's mount points are correctly converted into corresponding
26+
// TestTransformDatasetToVolume is a unit test function that verifies the transformation of a Dataset into a UFSPath
27+
// in the Alluxio runtime. It ensures that the Dataset's mount points are correctly converted into corresponding
2828
// container and host paths.
2929
//
3030
// Parameters:
@@ -60,7 +60,7 @@ func TestTransformDatasetToVolume(t *testing.T) {
6060
}},
6161
},
6262
}, &Alluxio{}, ufsPath},
63-
63+
6464
// Test case 2: Mount with a path specified
6565
{&datav1alpha1.AlluxioRuntime{}, &datav1alpha1.Dataset{
6666
Spec: datav1alpha1.DatasetSpec{
@@ -72,7 +72,7 @@ func TestTransformDatasetToVolume(t *testing.T) {
7272
},
7373
}, &Alluxio{}, ufsPath1},
7474
}
75-
75+
7676
// Iterate through all test cases and run the test.
7777
for _, test := range tests {
7878
// Create an instance of AlluxioEngine to call the function under test.

pkg/ddc/alluxio/utils_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -474,16 +474,16 @@ func TestGetMasterPod(t *testing.T) {
474474
}
475475
}
476476

477-
// TestGetMasterStatefulset tests the getMasterStatefulset method of the AlluxioEngine struct.
478-
// It verifies that the method correctly retrieves the expected StatefulSet based on the provided
479-
// AlluxioRuntime, name, and namespace. The test includes a sample runtime and expected
480-
// StatefulSet, checking for both successful retrieval and error scenarios.
481-
//
482-
// Parameters:
483-
// - t: The test framework's context, which provides methods for logging and error reporting.
484-
//
485-
// Returns:
486-
// - The test does not return any value, but it reports errors using the t.Error and
477+
// TestGetMasterStatefulset tests the getMasterStatefulset method of the AlluxioEngine struct.
478+
// It verifies that the method correctly retrieves the expected StatefulSet based on the provided
479+
// AlluxioRuntime, name, and namespace. The test includes a sample runtime and expected
480+
// StatefulSet, checking for both successful retrieval and error scenarios.
481+
//
482+
// Parameters:
483+
// - t: The test framework's context, which provides methods for logging and error reporting.
484+
//
485+
// Returns:
486+
// - The test does not return any value, but it reports errors using the t.Error and
487487
// t.Errorf methods to indicate whether the test passed or failed.
488488
func TestGetMasterStatefulset(t *testing.T) {
489489
type fields struct {

pkg/ddc/jindo/dataset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ func TestUpdateDatasetStatus(t *testing.T) {
253253
}
254254
}
255255

256-
// TestBindToDataset tests the BindToDataset method of JindoEngine to verify whether it can correctly bind the dataset to the runtime
257-
// and update the dataset's cache state and HCFS status. The test creates mock Dataset and JindoRuntime objects,
256+
// TestBindToDataset tests the BindToDataset method of JindoEngine to verify whether it can correctly bind the dataset to the runtime
257+
// and update the dataset's cache state and HCFS status. The test creates mock Dataset and JindoRuntime objects,
258258
// uses a fake client to simulate operations, and finally checks if the dataset's Phase, CacheStates, and HCFSStatus match the expected results.
259259
func TestBindToDataset(t *testing.T) {
260260
testDatasetInputs := []*datav1alpha1.Dataset{

pkg/ddc/jindo/delete_volume_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ func doTestCases(testCases []TestCase, t *testing.T) {
8383
//
8484
// Test Strategy:
8585
// 1. Setup test environment with mocked Kubernetes resources:
86-
// - PVs with 'CreatedBy=fluid' annotation to simulate Fluid-managed persistent volumes
87-
// - PVCs with different configurations (normal vs error cases)
86+
// - PVs with 'CreatedBy=fluid' annotation to simulate Fluid-managed persistent volumes
87+
// - PVCs with different configurations (normal vs error cases)
8888
// 2. Create 3 test scenarios using parameterized test pattern:
8989
// Case 1: Normal deletion (JindoEngineCommon)
90-
// - Input: Valid PV/PVC without conflicting annotations
91-
// - Expected: Successful deletion (isDeleted=true, isErr=false)
90+
// - Input: Valid PV/PVC without conflicting annotations
91+
// - Expected: Successful deletion (isDeleted=true, isErr=false)
9292
// Case 2: Protected PVC deletion (JindoEngineErr)
93-
// - Input: PVC with 'CreatedBy=fluid' annotation (protected resource)
94-
// - Expected: Failed deletion (isErr=true)
93+
// - Input: PVC with 'CreatedBy=fluid' annotation (protected resource)
94+
// - Expected: Failed deletion (isErr=true)
9595
// Case 3: Missing runtime scenario (JindoEngineNoRunTime)
96-
// - Input: Engine with runtime=false configuration
97-
// - Expected: Failed deletion (isErr=true)
96+
// - Input: Engine with runtime=false configuration
97+
// - Expected: Failed deletion (isErr=true)
9898
// 3. Verification: Uses doTestCases() helper to validate deletion outcomes against expectations
9999
//
100100
// Test Resources:

0 commit comments

Comments
 (0)