File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,24 @@ func TestTransformResourcesForWorkerWithOnlyRequest(t *testing.T) {
444444 }
445445}
446446
447+ // TestTransformResourcesForWorkerWithOnlyLimit is a unit test function that validates the transformation
448+ // of resource requirements for Alluxio workers when only resource limits are specified. It ensures that
449+ // the memory and CPU limits are correctly applied to the worker configuration and that the resulting
450+ // resource requests are handled as expected.
451+ //
452+ // The function performs the following steps:
453+ // 1. Defines resource requirements with limits for memory (20Gi) and CPU (500m).
454+ // 2. Sets up test cases to validate the transformation logic, including scenarios with and without
455+ // tiered store configurations.
456+ // 3. Initializes an AlluxioEngine instance with a fake client and runtime objects for testing.
457+ // 4. Transforms the resource requirements for the worker using the AlluxioEngine.
458+ // 5. Validates the transformed resource limits and requests against the expected results.
459+ //
460+ // Test cases include:
461+ // - A scenario where tiered store configuration is provided, ensuring memory limits and requests are set correctly.
462+ // - A scenario without tiered store configuration, ensuring memory limits are set but requests are not.
463+ //
464+ // Errors are reported if the transformation logic does not produce the expected results.
447465func TestTransformResourcesForWorkerWithOnlyLimit (t * testing.T ) {
448466
449467 resources := corev1.ResourceRequirements {}
You can’t perform that action at this time.
0 commit comments