File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,23 @@ import (
2626 "k8s.io/apimachinery/pkg/runtime"
2727)
2828
29+ // TestCheckMasterReady tests the CheckMasterReady method of the AlluxioEngine.
30+ // It simulates different runtime environments using fake Kubernetes clients and
31+ // verifies whether the engine correctly determines the readiness of the master component.
32+ //
33+ // Parameters:
34+ // - t *testing.T: Standard testing object used for logging and test failure reporting.
35+ //
36+ // Return: None (standard Go testing function).
37+ //
38+ // Notes:
39+ // - Uses a fake client to mock interactions with the Kubernetes API server.
40+ // - Creates multiple AlluxioRuntime and StatefulSet objects with specific ready states.
41+ // - Tests two scenarios:
42+ // 1. A runtime with insufficient master replicas should result in false readiness.
43+ // 2. A runtime with all required master replicas ready should result in true readiness.
44+ // - Also verifies that when readiness is true, the runtime's status conditions are updated correctly.
45+ // - Fails the test if actual readiness does not match the expected result or if status update is missing.
2946func TestCheckMasterReady (t * testing.T ) {
3047 statefulsetInputs := []v1.StatefulSet {
3148 {
You can’t perform that action at this time.
0 commit comments