Skip to content

Commit 78f6b85

Browse files
committed
Merge remote-tracking branch 'upstream/main' into renovatecfg
2 parents 7eb8096 + 9f27359 commit 78f6b85

File tree

3 files changed

+88
-81
lines changed

3 files changed

+88
-81
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@
99

1010
# Global rule:
1111
* @opendatahub-io/opendatahub-tests-contributors
12+
13+
# Test directory specific rules
14+
tests/model_explainability/ @adolfo-ab @sheltoncyril
15+
tests/model_registry/ @dbasunag @lugi0 @fege
16+
tests/model_serving/ @mwaykole @Raghul-M
17+
tests/rag/ @jgarciao @jiripetrlik
18+
tests/workbenches @jstourac @andyatmiami

tests/workbenches/conftest.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44
from pytest_testconfig import config as py_config
55

6-
6+
from simple_logger.logger import get_logger
77
from tests.workbenches.utils import get_username
88

99
from kubernetes.dynamic import DynamicClient
@@ -13,13 +13,14 @@
1313
from ocp_resources.persistent_volume_claim import PersistentVolumeClaim
1414
from ocp_resources.route import Route
1515
from ocp_resources.notebook import Notebook
16-
from ocp_resources.cluster_operator import ClusterOperator
17-
16+
from ocp_resources.config_imageregistry_operator_openshift_io import Config
1817

19-
from utilities.constants import Labels, Timeout
18+
from utilities.constants import Labels
2019
from utilities import constants
2120
from utilities.constants import INTERNAL_IMAGE_REGISTRY_PATH
2221

22+
LOGGER = get_logger(name=__name__)
23+
2324

2425
@pytest.fixture(scope="function")
2526
def users_persistent_volume_claim(
@@ -40,21 +41,20 @@ def users_persistent_volume_claim(
4041
@pytest.fixture(scope="function")
4142
def internal_image_registry(
4243
admin_client: DynamicClient,
43-
) -> Generator[ClusterOperator | None, None, None]:
44+
) -> Generator[bool, None, None]:
45+
"""Check if internal image registry is available by checking the imageregistry config managementState"""
4446
try:
45-
image_registry = ClusterOperator(
46-
client=admin_client,
47-
name="image-registry",
48-
ensure_exists=True,
49-
)
50-
image_registry.wait_for_condition(
51-
condition=ClusterOperator.Condition.AVAILABLE,
52-
status=ClusterOperator.Condition.Status.TRUE,
53-
timeout=Timeout.TIMEOUT_30SEC,
54-
)
55-
yield image_registry
56-
except ResourceNotFoundError:
57-
yield None
47+
# Access the imageregistry.operator.openshift.io/v1 Config resource named "cluster"
48+
config_instance = Config(client=admin_client, name="cluster")
49+
50+
management_state = config_instance.instance.spec.get("managementState", "").lower()
51+
is_available = management_state == "managed"
52+
53+
LOGGER.info(f"Image registry management state: {management_state}, available: {is_available}")
54+
yield is_available
55+
except (ResourceNotFoundError, Exception) as e:
56+
LOGGER.warning(f"Failed to check image registry config: {e}")
57+
yield False
5858

5959

6060
@pytest.fixture(scope="function")
@@ -68,7 +68,7 @@ def minimal_image() -> Generator[str, None, None]:
6868
def default_notebook(
6969
request: pytest.FixtureRequest,
7070
admin_client: DynamicClient,
71-
internal_image_registry: ClusterOperator | None,
71+
internal_image_registry: bool,
7272
minimal_image: str,
7373
) -> Generator[Notebook, None, None]:
7474
"""Returns a new Notebook CR for a given namespace, name, and image"""

0 commit comments

Comments
 (0)