Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions tests/model_registry/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from model_registry import ModelRegistry as ModelRegistryClient
from semver import Version
from utilities.general import wait_for_pods_by_labels
from utilities.infra import get_product_version

LOGGER = get_logger(name=__name__)

Expand Down Expand Up @@ -226,7 +227,10 @@ def model_registry_instance(
teardown=teardown_resources,
) as mr:
mr.wait_for_condition(condition="Available", status="True")
mr.wait_for_condition(condition="OAuthProxyAvailable", status="True")
if is_model_registry_oauth or get_product_version(admin_client=admin_client) >= Version.parse(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main is now pointing to 2.23. We should not work around testops image tag issue. They need to prioritize and fix it. We should not sign off otherwise.

version="2.22.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use a constant for the version number?

):
mr.wait_for_condition(condition="OAuthProxyAvailable", status="True")

yield mr

Expand Down Expand Up @@ -502,8 +506,12 @@ def model_registry_instance_pod(admin_client: DynamicClient) -> Generator[Pod, A


@pytest.fixture(scope="class")
def is_model_registry_oauth(request: FixtureRequest) -> bool:
return getattr(request, "param", {}).get("use_oauth_proxy", True)
def is_model_registry_oauth(request: FixtureRequest, get_product_version: Version, admin_client: DynamicClient) -> bool:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not change this. It should be based on request.param and main is aligned with 2.23, so it should always be oauth.

product_version = get_product_version(admin_client=admin_client)
if product_version >= Version.parse(version="2.22.0"):
return getattr(request, "param", {}).get("use_oauth_proxy", True)
else:
return getattr(request, "param", {}).get("use_oauth_proxy", False)


@pytest.fixture(scope="session")
Expand Down
Loading