From 2408b7a9834f665e329acfcd2d7515596040e06c Mon Sep 17 00:00:00 2001 From: Ignas Baranauskas Date: Mon, 10 Jun 2024 09:35:00 +0100 Subject: [PATCH] Tests for the annotation prefix to RayCluster --- tests/test-case-no-mcad.yamls | 2 ++ tests/unit_test.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tests/test-case-no-mcad.yamls b/tests/test-case-no-mcad.yamls index 367703d67..b69c0d60f 100644 --- a/tests/test-case-no-mcad.yamls +++ b/tests/test-case-no-mcad.yamls @@ -2,6 +2,8 @@ apiVersion: ray.io/v1 kind: RayCluster metadata: + annotations: + app.kubernetes.io/managed-by: test-prefix labels: controller-tools.k8s.io: '1.0' kueue.x-k8s.io/queue-name: local-queue-default diff --git a/tests/unit_test.py b/tests/unit_test.py index 32d730c4d..b54d65490 100644 --- a/tests/unit_test.py +++ b/tests/unit_test.py @@ -345,6 +345,8 @@ def test_cluster_creation_no_mcad(mocker): "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object", return_value=get_local_queue("kueue.x-k8s.io", "v1beta1", "ns", "localqueues"), ) + mocker.patch("os.environ.get", return_value="test-prefix") + config = createClusterConfig() config.name = "unit-test-cluster-ray" config.write_to_file = True @@ -373,6 +375,7 @@ def test_cluster_creation_no_mcad_local_queue(mocker): "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object", return_value=get_local_queue("kueue.x-k8s.io", "v1beta1", "ns", "localqueues"), ) + mocker.patch("os.environ.get", return_value="test-prefix") config = createClusterConfig() config.name = "unit-test-cluster-ray" config.appwrapper = False