Skip to content

Commit c85a93b

Browse files
committed
Fix gofmt issue
Signed-off-by: cheyang <cheyang@163.com>
1 parent 2bca697 commit c85a93b

6 files changed

Lines changed: 35 additions & 33 deletions

File tree

pkg/ddc/alluxio/delete_volume_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ type TestCase struct {
3838
}
3939

4040
// newTestAlluxioEngine creates an instance of AlluxioEngine for testing purposes.
41-
//
41+
//
4242
// Parameters:
43-
// client - A Kubernetes client used for interactions with the API server.
44-
// name - The name for the AlluxioEngine (used for associated PV/PVC resources in tests).
45-
// namespace - The namespace where the resources reside.
46-
// withRunTime - A flag indicating whether the engine should be initialized with runtime information.
47-
// When true, an AlluxioRuntime instance and corresponding runtimeInfo are created;
48-
// when false, both runtime and runtimeInfo are set to nil to simulate a scenario without runtime support.
49-
//
43+
//
44+
// client - A Kubernetes client used for interactions with the API server.
45+
// name - The name for the AlluxioEngine (used for associated PV/PVC resources in tests).
46+
// namespace - The namespace where the resources reside.
47+
// withRunTime - A flag indicating whether the engine should be initialized with runtime information.
48+
// When true, an AlluxioRuntime instance and corresponding runtimeInfo are created;
49+
// when false, both runtime and runtimeInfo are set to nil to simulate a scenario without runtime support.
50+
//
5051
// Returns:
51-
// A pointer to an AlluxioEngine instance configured according to the provided parameters.
52+
//
53+
// A pointer to an AlluxioEngine instance configured according to the provided parameters.
5254
func newTestAlluxioEngine(client client.Client, name string, namespace string, withRunTime bool) *AlluxioEngine {
5355
runTime := &datav1alpha1.AlluxioRuntime{}
5456
runTimeInfo, _ := base.BuildRuntimeInfo(name, namespace, "alluxio")

pkg/ddc/alluxio/transform_volumes_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ func TestTransformWorkerVolumes(t *testing.T) {
248248
}
249249
}
250250

251-
// TestTransformFuseVolumes tests the behavior of the transformFuseVolumes method.
252-
// It defines multiple test cases to verify whether the Volumes and VolumeMounts
253-
// in an AlluxioRuntime object are correctly transformed into the Alluxio structure,
251+
// TestTransformFuseVolumes tests the behavior of the transformFuseVolumes method.
252+
// It defines multiple test cases to verify whether the Volumes and VolumeMounts
253+
// in an AlluxioRuntime object are correctly transformed into the Alluxio structure,
254254
// and checks the error handling logic.
255255
func TestTransformFuseVolumes(t *testing.T) {
256256
type testCase struct {

pkg/ddc/alluxio/ufs_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,19 @@ func TestShouldCheckUFS(t *testing.T) {
239239
}
240240
}
241241

242-
243242
// TestPrepareUFS tests the PrepareUFS method of AlluxioEngine.
244243
// This method prepares the underlying file system (UFS) by checking
245244
// the Alluxio master state, mounting UFS, and performing necessary
246245
// metadata synchronization.
247246
//
248247
// Test logic:
249-
// 1. Create multiple test cases to simulate different states of
250-
// AlluxioRuntime, Dataset, and StatefulSet.
251-
// 2. Initialize AlluxioEngine and its dependencies using a fake client.
252-
// 3. Use Monkey Patching to mock the behavior of AlluxioFileUtils methods.
253-
// 4. Call e.PrepareUFS() and verify whether the UFS mounting process
254-
// executes correctly.
255-
// 5. Assert that the returned errors match the expected outcomes.
248+
// 1. Create multiple test cases to simulate different states of
249+
// AlluxioRuntime, Dataset, and StatefulSet.
250+
// 2. Initialize AlluxioEngine and its dependencies using a fake client.
251+
// 3. Use Monkey Patching to mock the behavior of AlluxioFileUtils methods.
252+
// 4. Call e.PrepareUFS() and verify whether the UFS mounting process
253+
// executes correctly.
254+
// 5. Assert that the returned errors match the expected outcomes.
256255
//
257256
// Parameters:
258257
// - t *testing.T: The testing context provided by the Go testing framework.

pkg/ddc/alluxio/utils_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -369,29 +369,29 @@ func TestGetDataSetFileNum(t *testing.T) {
369369
}
370370
}
371371

372-
// TestGetRuntime tests the AlluxioEngine.getRuntime() method to verify it correctly retrieves
372+
// TestGetRuntime tests the AlluxioEngine.getRuntime() method to verify it correctly retrieves
373373
// the AlluxioRuntime custom resource from the Kubernetes cluster.
374-
//
374+
//
375375
// Test Structure:
376376
// - Defines a test table with multiple test cases (though currently only one example exists).
377377
// - Each test case specifies:
378-
// * Input fields: Simulated AlluxioEngine instance configuration.
379-
// * Expected output: The AlluxioRuntime object that should be returned.
380-
// * Error expectation: Whether an error is expected during retrieval.
381-
//
378+
// - Input fields: Simulated AlluxioEngine instance configuration.
379+
// - Expected output: The AlluxioRuntime object that should be returned.
380+
// - Error expectation: Whether an error is expected during retrieval.
381+
//
382382
// Key Testing Components:
383-
// - Uses Kubernetes client-go testing utilities (fake client, scheme registration) to mock
384-
// API server interactions, avoiding real cluster dependencies.
385-
// - Validates both successful retrieval and error conditions.
386-
// - Checks deep equality between retrieved and expected objects to ensure metadata accuracy.
383+
// - Uses Kubernetes client-go testing utilities (fake client, scheme registration) to mock
384+
// API server interactions, avoiding real cluster dependencies.
385+
// - Validates both successful retrieval and error conditions.
386+
// - Checks deep equality between retrieved and expected objects to ensure metadata accuracy.
387387
//
388388
// Test Workflow for Each Case:
389389
// 1. Register required Kubernetes resource types (AlluxioRuntime, core v1) into the scheme.
390390
// 2. Initialize a fake client preloaded with the expected AlluxioRuntime object.
391391
// 3. Instantiate the AlluxioEngine with test-specific configurations and the fake client.
392392
// 4. Execute getRuntime() and validate:
393-
// - Error behavior matches expectations
394-
// - Retrieved object matches the expected object structure exactly
393+
// - Error behavior matches expectations
394+
// - Retrieved object matches the expected object structure exactly
395395
//
396396
// Edge Cases Covered (via additional test cases in TODO):
397397
// - Non-existent runtime

pkg/ddc/jindo/load_data_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ func Test_genDataLoadValue(t *testing.T) {
554554
}
555555
}
556556

557-
// TestGenerateDataLoadValueFileWithRuntimeHDD tests the generation of data load value files
557+
// TestGenerateDataLoadValueFileWithRuntimeHDD tests the generation of data load value files
558558
// when using a JindoRuntime with an HDD-based tiered storage configuration.
559559
//
560560
// This function ensures that the dataset and JindoRuntime configurations are correctly initialized

pkg/ddc/juicefs/datasetinfo_parser.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func parseCacheInfoFromConfigMap(configMap *v1.ConfigMap) (cacheinfo map[string]
6363
// - client: A Kubernetes client used to interact with the cluster.
6464
// - name: The base name of the target ConfigMap.
6565
// - namespace: The namespace where the ConfigMap is located.
66+
//
6667
// Returns:
6768
// - A map containing file system information parsed from the ConfigMap.
6869
// - An error if the ConfigMap retrieval or parsing fails.

0 commit comments

Comments
 (0)