File tree Expand file tree Collapse file tree 8 files changed +68
-9
lines changed
model_serving/model_server/multi_node Expand file tree Collapse file tree 8 files changed +68
-9
lines changed Original file line number Diff line number Diff line change 1515 runs-on : ubuntu-latest
1616 steps :
1717 - name : Checkout Repository
18- uses : actions/checkout@v4
18+ uses : actions/checkout@v5
19+ with :
20+ ref : ${{ github.event.pull_request.base.ref }}
1921 - name : Set env TAG
2022 run : |
2123 if [ ${{ github.event.pull_request.base.ref }} == "main" ]; then
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ testpaths = tests
55markers =
66 # General
77 polarion: Store polarion test ID
8-
8+ cluster_health: Tests that verifies that cluster is healthy to begin testing
9+ operator_health: Tests that verifies that OpenDataHub/RHOAI operators are healthy and functioning correctly
910 # CI
1011 smoke: Mark tests as smoke tests; covers core functionality of the product. Aims to ensure that the build is stable enough for further testing.
1112 sanity: Mark tests as sanity tests. Aims to verify that specific functionality is working as expected.
Original file line number Diff line number Diff line change 1+ import pytest
2+ from ocp_resources .node import Node
3+ from ocp_utilities .infra import assert_nodes_in_healthy_condition , assert_nodes_schedulable
4+ from simple_logger .logger import get_logger
5+
6+ LOGGER = get_logger (name = __name__ )
7+
8+
9+ @pytest .mark .cluster_health
10+ def test_cluster_node_healthy (nodes : list [Node ]) -> None :
11+ """
12+ Tests if the cluster nodes are healthy
13+ """
14+ assert_nodes_in_healthy_condition (nodes = nodes , healthy_node_condition_type = {"KubeletReady" : "True" })
15+ assert_nodes_schedulable (nodes = nodes )
Original file line number Diff line number Diff line change 1+ import pytest
2+ from ocp_resources .data_science_cluster import DataScienceCluster
3+ from simple_logger .logger import get_logger
4+
5+ from tests .cluster_health .utils import wait_for_dsc_status_ready
6+
7+ LOGGER = get_logger (name = __name__ )
8+
9+
10+ @pytest .mark .operator_health
11+ def test_data_science_cluster_healthy (dsc_resource : DataScienceCluster ) -> None :
12+ """
13+ Checks if a data science cluster is healthy
14+ """
15+ wait_for_dsc_status_ready (dsc_resource = dsc_resource )
Original file line number Diff line number Diff line change 1+ from simple_logger .logger import get_logger
2+
3+ from ocp_resources .data_science_cluster import DataScienceCluster
4+
5+ from timeout_sampler import retry
6+
7+ LOGGER = get_logger (name = __name__ )
8+
9+
10+ class ResourceNotReadyError (Exception ):
11+ pass
12+
13+
14+ @retry (
15+ wait_timeout = 120 ,
16+ sleep = 5 ,
17+ exceptions_dict = {ResourceNotReadyError : []},
18+ )
19+ def wait_for_dsc_status_ready (dsc_resource : DataScienceCluster ) -> bool :
20+ LOGGER .info (f"Wait for DSC { dsc_resource .name } are { dsc_resource .Status .READY } ." )
21+ if dsc_resource .status == dsc_resource .Status .READY :
22+ return True
23+ raise ResourceNotReadyError (
24+ f"DSC { dsc_resource .name } is not ready.\n Current status: { dsc_resource .instance .status } "
25+ )
Original file line number Diff line number Diff line change 99import yaml
1010from _pytest .tmpdir import TempPathFactory
1111from ocp_resources .config_map import ConfigMap
12+ from ocp_resources .node import Node
1213from ocp_resources .secret import Secret
1314from pyhelper_utils .shell import run_command
1415from pytest import FixtureRequest , Config
@@ -303,3 +304,8 @@ def cluster_monitoring_config(admin_client: DynamicClient) -> Generator[ConfigMa
303304 data = data ,
304305 ) as cm :
305306 yield cm
307+
308+
309+ @pytest .fixture (scope = "session" )
310+ def nodes (admin_client : DynamicClient ) -> list [Node ]:
311+ return list (Node .get (dyn_client = admin_client ))
Original file line number Diff line number Diff line change 1919)
2020
2121
22- @pytest .fixture (scope = "session" )
23- def nodes (admin_client : DynamicClient ) -> list [Node ]:
24- return list (Node .get (dyn_client = admin_client ))
25-
26-
2722@pytest .fixture (scope = "session" )
2823def nvidia_gpu_nodes (nodes : list [Node ]) -> list [Node ]:
2924 return [node for node in nodes if "nvidia.com/gpu.present" in node .labels .keys ()]
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ def get_jira_connection() -> JIRA:
2323
2424 """
2525 return JIRA (
26- token_auth = os .getenv ("PYTEST_JIRA_TOKEN " ),
27- options = { "server" : os .getenv ("PYTEST_JIRA_URL" )} ,
26+ server = os .getenv ("PYTEST_JIRA_URL " ),
27+ basic_auth = ( os . getenv ( "PYTEST_JIRA_USERNAME" ), os .getenv ("PYTEST_JIRA_TOKEN" )) ,
2828 )
2929
3030
You can’t perform that action at this time.
0 commit comments