Skip to content

Commit e551e66

Browse files
committed
Add cluster health tests (#551)
1 parent d7fb7c7 commit e551e66

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ markers =
1818
fuzzer: Mark tests that use fuzzing and are probably going to generate unanticipated failures.
1919
ocp_interop: Interop testing with Openshift.
2020
downstream_only: Tests that are specific to downstream
21+
cluster_health: Tests that verifies that cluster is healthy to begin testing
2122

2223
# Model server
2324
modelmesh: Mark tests which are model mesh tests

tests/cluster_health/__init__.py

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pytest
2+
3+
from ocp_resources.data_science_cluster import DataScienceCluster
4+
from ocp_resources.dsc_initialization import DSCInitialization
5+
from ocp_resources.node import Node
6+
from ocp_utilities.infra import assert_nodes_in_healthy_condition, assert_nodes_schedulable
7+
from utilities.infra import wait_for_dsci_status_ready, wait_for_dsc_status_ready
8+
9+
10+
@pytest.mark.cluster_health
11+
def test_cluster_node_healthy(nodes: list[Node]):
12+
assert_nodes_in_healthy_condition(nodes=nodes, healthy_node_condition_type={"KubeletReady": "True"})
13+
assert_nodes_schedulable(nodes=nodes)
14+
15+
16+
@pytest.mark.cluster_health
17+
def test_data_science_cluster_initialization_healthy(dsci_resource: DSCInitialization):
18+
wait_for_dsci_status_ready(dsci_resource=dsci_resource)
19+
20+
21+
@pytest.mark.cluster_health
22+
def test_data_science_cluster_healthy(dsc_resource: DataScienceCluster):
23+
wait_for_dsc_status_ready(dsc_resource=dsc_resource)

0 commit comments

Comments
 (0)