|
1 | 1 | import pytest |
2 | | -from kubernetes.dynamic import DynamicClient |
3 | | -from ocp_resources.data_science_cluster import DataScienceCluster |
4 | | -from ocp_resources.dsc_initialization import DSCInitialization |
5 | 2 | from ocp_resources.node import Node |
6 | 3 | from ocp_utilities.infra import assert_nodes_in_healthy_condition, assert_nodes_schedulable |
7 | | -from utilities.general import wait_for_pods_running |
8 | | -from utilities.infra import wait_for_dsci_status_ready, wait_for_dsc_status_ready |
9 | | -from pytest_testconfig import config as py_config |
10 | 4 | from simple_logger.logger import get_logger |
11 | 5 |
|
12 | 6 | LOGGER = get_logger(name=__name__) |
13 | 7 |
|
14 | 8 |
|
15 | 9 | @pytest.mark.cluster_health |
16 | | -def test_cluster_node_healthy(nodes: list[Node]): |
| 10 | +def test_cluster_node_healthy(nodes: list[Node]) -> None: |
| 11 | + """ |
| 12 | + Tests if the cluster nodes are healthy |
| 13 | + """ |
17 | 14 | assert_nodes_in_healthy_condition(nodes=nodes, healthy_node_condition_type={"KubeletReady": "True"}) |
18 | 15 | assert_nodes_schedulable(nodes=nodes) |
19 | | - |
20 | | - |
21 | | -@pytest.mark.cluster_health |
22 | | -def test_data_science_cluster_initialization_healthy(dsci_resource: DSCInitialization): |
23 | | - wait_for_dsci_status_ready(dsci_resource=dsci_resource) |
24 | | - |
25 | | - |
26 | | -@pytest.mark.cluster_health |
27 | | -def test_data_science_cluster_healthy(dsc_resource: DataScienceCluster): |
28 | | - wait_for_dsc_status_ready(dsc_resource=dsc_resource) |
29 | | - |
30 | | - |
31 | | -@pytest.mark.parametrize( |
32 | | - "namespace_name", |
33 | | - [ |
34 | | - pytest.param( |
35 | | - py_config["operator_namespace"], |
36 | | - id="test_operator_namespace_pod_healthy", |
37 | | - ), |
38 | | - pytest.param( |
39 | | - py_config["applications_namespace"], |
40 | | - id="test_application_namespace_pod_healthy", |
41 | | - ), |
42 | | - ], |
43 | | -) |
44 | | -@pytest.mark.cluster_health |
45 | | -def test_pods_cluster_healthy(admin_client: DynamicClient, namespace_name: str): |
46 | | - LOGGER.info(f"Testing Pods in namespace {namespace_name} for cluster health") |
47 | | - wait_for_pods_running(admin_client=admin_client, namespace_name=namespace_name) |
0 commit comments