sal/kubernetes/tests/rhai/run_all_tests.rhai
Mahmoud-Emad 52f2f7e3c4 feat: Add Kubernetes module to SAL
- Add Kubernetes cluster management and operations
- Include pod, service, and deployment management
- Implement pattern-based resource deletion
- Support namespace creation and management
- Provide Rhai scripting wrappers for all functions
- Include production safety features (timeouts, retries, rate limiting)
2025-06-30 14:56:54 +03:00

87 lines
2.4 KiB
Plaintext

//! Run all Kubernetes Rhai tests
//!
//! This script runs all the Kubernetes Rhai tests in sequence.
print("=== Running All Kubernetes Rhai Tests ===");
print("");
// Test configuration
let test_files = [
"basic_kubernetes.rhai",
"namespace_operations.rhai",
"resource_management.rhai"
];
let passed_tests = 0;
let total_tests = test_files.len();
print("Found " + total_tests + " test files to run:");
for test_file in test_files {
print(" - " + test_file);
}
print("");
// Note: In a real implementation, we would use eval_file or similar
// For now, this serves as documentation of the test structure
print("=== Test Execution Summary ===");
print("");
print("To run these tests individually:");
for test_file in test_files {
print(" herodo kubernetes/tests/rhai/" + test_file);
}
print("");
print("To run with Kubernetes cluster:");
print(" KUBERNETES_TEST_ENABLED=1 herodo kubernetes/tests/rhai/basic_kubernetes.rhai");
print("");
// Basic validation that we can create a manager
print("=== Quick Validation ===");
try {
let km = kubernetes_manager_new("default");
let ns = namespace(km);
print("✓ KubernetesManager creation works");
print("✓ Namespace getter works: " + ns);
passed_tests = passed_tests + 1;
} catch(e) {
print("✗ Basic validation failed: " + e);
}
// Test function registration
print("");
print("=== Function Registration Check ===");
let required_functions = [
"kubernetes_manager_new",
"namespace",
"pods_list",
"services_list",
"deployments_list",
"namespaces_list",
"resource_counts",
"namespace_create",
"namespace_exists",
"delete",
"pod_delete",
"service_delete",
"deployment_delete"
];
let registered_functions = 0;
for func_name in required_functions {
// We can't easily test function existence in Rhai, but we can document them
print("✓ " + func_name + " should be registered");
registered_functions = registered_functions + 1;
}
print("");
print("=== Summary ===");
print("Required functions: " + registered_functions + "/" + required_functions.len());
print("Basic validation: " + (passed_tests > 0 ? "PASSED" : "FAILED"));
print("");
print("For full testing with a Kubernetes cluster:");
print("1. Ensure you have a running Kubernetes cluster");
print("2. Set KUBERNETES_TEST_ENABLED=1");
print("3. Run individual test files");
print("");
print("=== All tests documentation completed ===");