Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 9 additions & 9 deletions tests/model_registry/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def updated_dsc_component_state_scope_class(
)
if component_patch.get(DscComponents.MODELREGISTRY):
namespace = Namespace(
name=dsc_resource.instance.spec.components.modelregistry.registriesNamespace, ensure_exists=True
name=dsc_resource.instance.spec.components.modelregistry.registriesNamespace, wait_for_resource=True
)
namespace.wait_for_status(status=Namespace.Status.ACTIVE)
wait_for_pods_running(
Expand All @@ -321,8 +321,8 @@ def updated_dsc_component_state_scope_class(
):
# Since namespace specified in registriesNamespace is automatically created after setting
# managementStateto Managed. We need to explicitly delete it on clean up.
namespace = Namespace(name=value["registriesNamespace"], ensure_exists=True)
if namespace:
namespace = Namespace(name=value["registriesNamespace"], wait_for_resource=True)
if namespace.exists:
Comment thread
dbasunag marked this conversation as resolved.
namespace.delete(wait=True)


Expand All @@ -343,7 +343,7 @@ def pre_upgrade_dsc_patch(
editor.update()
dsc_resource.wait_for_condition(condition=DscComponents.COMPONENT_MAPPING["modelregistry"], status="True")
namespace = Namespace(
name=dsc_resource.instance.spec.components.modelregistry.registriesNamespace, ensure_exists=True
name=dsc_resource.instance.spec.components.modelregistry.registriesNamespace, wait_for_resource=True
)
namespace.wait_for_status(status=Namespace.Status.ACTIVE)
wait_for_pods_running(
Expand Down Expand Up @@ -375,8 +375,8 @@ def post_upgrade_dsc_patch(
editor = ResourceEditor(patches={dsc_resource: {"spec": {"components": component_patch}}})
editor.update()
ns = original_components.get(DscComponents.MODELREGISTRY).get("registriesNamespace")
namespace = Namespace(name=ns, ensure_exists=True)
if namespace:
namespace = Namespace(name=ns, wait_for_resource=True)
if namespace.exists:
namespace.delete(wait=True)


Expand Down Expand Up @@ -564,7 +564,7 @@ def updated_dsc_component_state_parametrized(
dsc_resource.wait_for_condition(
condition=DscComponents.COMPONENT_MAPPING[DscComponents.MODELREGISTRY], status="True"
)
namespace = Namespace(name=namespace_name, ensure_exists=True)
namespace = Namespace(name=namespace_name, wait_for_resource=True)
namespace.wait_for_status(status=Namespace.Status.ACTIVE)
wait_for_pods_running(
admin_client=admin_client,
Expand All @@ -574,8 +574,8 @@ def updated_dsc_component_state_parametrized(
yield dsc_resource

# Clean up the dynamic namespace
namespace = Namespace(name=namespace_name, ensure_exists=True)
if namespace:
namespace = Namespace(name=namespace_name, wait_for_resource=True)
if namespace.exists:
namespace.delete(wait=True)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
indirect=True,
)
@pytest.mark.usefixtures("pre_upgrade_dsc_patch")
@pytest.mark.usefixtures("pre_upgrade_dsc_patch", "model_registry_mysql_metadata_db", "model_registry_instance_mysql")
class TestPreUpgradeModelRegistry:
@pytest.mark.pre_upgrade
def test_registering_model_pre_upgrade(
Expand Down