Skip to content

Commit 888d035

Browse files
RHOAIENG-61469: fix missing label causing upgrade tests to fail
1 parent bcd1ed5 commit 888d035

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ E2E_TEST_IMAGE ?= quay.io/opendatahub/codeflare-sdk-tests:${E2E_TEST_IMAGE_VERSI
77
build-test-image:
88
@echo "Building test image: $(E2E_TEST_IMAGE)"
99
# Build the Docker image using podman
10-
podman build -f images/tests/Dockerfile -t $(E2E_TEST_IMAGE) .
10+
podman build --platform linux/amd64 -f images/tests/Dockerfile -t $(E2E_TEST_IMAGE) .
1111

1212
# Push the test image
1313
.PHONY: push-test-image

tests/e2e/support.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,20 +286,35 @@ def create_new_local_queue(self, num_queues):
286286
self.local_queues.append(local_queue_name)
287287

288288

289-
def create_namespace_with_name(self, namespace_name):
289+
def create_namespace_with_name(self, namespace_name, kueue_managed=True):
290290
self.namespace = namespace_name
291+
labels = {"kueue.openshift.io/managed": "true"} if kueue_managed else {}
291292
try:
292293
namespace_body = client.V1Namespace(
293-
metadata=client.V1ObjectMeta(name=self.namespace)
294+
metadata=client.V1ObjectMeta(
295+
name=self.namespace,
296+
labels=labels,
297+
)
294298
)
295299
self.api_instance.create_namespace(namespace_body)
296300
except Exception as e:
297301
# Check if it's an AlreadyExists error (409 Conflict) and ignore it
298302
if hasattr(e, "status") and e.status == 409:
299-
# Namespace already exists, which is fine - just continue
300303
print(
301304
f"Warning: Namespace '{namespace_name}' already exists, continuing..."
302305
)
306+
if kueue_managed:
307+
try:
308+
self.api_instance.patch_namespace(
309+
namespace_name,
310+
{
311+
"metadata": {
312+
"labels": {"kueue.openshift.io/managed": "true"}
313+
}
314+
},
315+
)
316+
except Exception:
317+
pass
303318
return
304319
return _kube_api_error_handling(e)
305320

tests/ui/pages/distributed_workloads_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def verify_cluster_in_workload_list(self, cluster_name):
10051005
# Look for the cluster name in the table
10061006
cluster_cell = self.wait.until(
10071007
EC.presence_of_element_located(
1008-
(By.XPATH, f"//td[contains(text(), '{cluster_name}')]")
1008+
(By.XPATH, f"//td[contains(., '{cluster_name}')]")
10091009
)
10101010
)
10111011
is_visible = cluster_cell.is_displayed()

tests/upgrade/01_raycluster_sdk_upgrade_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def setup_method(self):
2727
create_cluster_queue(self, cluster_queue, flavor)
2828
create_resource_flavor(self, flavor)
2929
create_local_queue(self, cluster_queue, local_queue)
30+
# Populate plural lists used by delete_kueue_resources
31+
self.cluster_queues = [cluster_queue]
32+
self.resource_flavors = [flavor]
3033
except Exception as e:
3134
delete_namespace(self)
3235
delete_kueue_resources(self)
@@ -80,6 +83,7 @@ def run_mnist_raycluster_sdk_oauth(self):
8083
worker_memory_requests=6,
8184
worker_memory_limits=8,
8285
image=ray_image,
86+
local_queue=local_queue,
8387
write_to_file=True,
8488
verify_tls=False,
8589
)

0 commit comments

Comments
 (0)