Skip to content

Commit

Permalink
tests(integration): Rename DEFAULT_NAMESPACE to WORKLOADS_NAMESPACE
Browse files Browse the repository at this point in the history
  • Loading branch information
orfeas-k committed Oct 5, 2023
1 parent 28f9bfd commit d89469a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
verbs=None,
)
SELDON_CM_NAME = "seldon-config"
DEFAULT_NAMESPACE = "default"
WORKLOADS_NAMESPACE = "default"

with open("tests/integration/test_data/expected_seldon_cm.json", "r") as json_file:
SELDON_CONFIG = json.load(json_file)
Expand Down Expand Up @@ -171,7 +171,7 @@ async def test_seldon_alert_rules(ops_test: OpsTest):
# NOTE: This test is re-using deployments created in test_build_and_deploy()
# Use namespace "default" to create seldon deployments
# due to https://github.com/canonical/seldon-core-operator/issues/218
namespace = DEFAULT_NAMESPACE
namespace = WORKLOADS_NAMESPACE
client = Client()

# setup Prometheus
Expand Down Expand Up @@ -284,7 +284,7 @@ async def test_seldon_deployment(ops_test: OpsTest):
# NOTE: This test is re-using deployment created in test_build_and_deploy()
# Use namespace "default" to create seldon deployments
# due to https://github.com/canonical/seldon-core-operator/issues/218
namespace = DEFAULT_NAMESPACE
namespace = WORKLOADS_NAMESPACE
client = Client()

this_ns = client.get(res=Namespace, name=namespace)
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/test_seldon_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
verbs=None,
)
TEST_LABEL = {"testing-seldon-deployments": "true"}
DEFAULT_NAMESPACE = "default"
WORKLOADS_NAMESPACE = "default"


@pytest.fixture(scope="session")
Expand All @@ -48,7 +48,7 @@ def lightkube_client() -> Client:
@pytest.fixture(scope="module")
def patch_namespace_with_seldon_label(lightkube_client: Client, ops_test: OpsTest):
"""Patch the current namespace with Seldon specific labels."""
this_ns = lightkube_client.get(res=Namespace, name=DEFAULT_NAMESPACE)
this_ns = lightkube_client.get(res=Namespace, name=WORKLOADS_NAMESPACE)
this_ns.metadata.labels.update({"serving.kubeflow.org/inferenceservice": "enabled"})
lightkube_client.patch(res=Namespace, name=this_ns.metadata.name, obj=this_ns)

Expand All @@ -61,7 +61,7 @@ def remove_seldon_deployment(lightkube_client: Client, ops_test: OpsTest):
# remove Seldon Deployment
# Use namespace "default" to create seldon deployments
# due to https://github.com/canonical/seldon-core-operator/issues/218
namespace = DEFAULT_NAMESPACE
namespace = WORKLOADS_NAMESPACE
resource_to_delete = lightkube_client.list(
SELDON_DEPLOYMENT, namespace=namespace, labels=TEST_LABEL
)
Expand Down Expand Up @@ -279,7 +279,7 @@ async def test_seldon_predictor_server(
"""
# Use namespace "default" to create seldon deployments
# due to https://github.com/canonical/seldon-core-operator/issues/218
namespace = DEFAULT_NAMESPACE
namespace = WORKLOADS_NAMESPACE
# retrieve predictor server information and create Seldon Depoloyment
with open(f"tests/assets/crs/{server_config}") as f:
deploy_yaml = yaml.safe_load(f.read())
Expand Down

0 comments on commit d89469a

Please sign in to comment.