From 3864bcfc61e17612b0c726b9b9b3e25fcd3569b2 Mon Sep 17 00:00:00 2001 From: Srihari Venkataramaiah Date: Fri, 14 Jun 2024 15:24:56 +0530 Subject: [PATCH] update Token Authentication for TestMnistJobSubmit before step get_cluster (#561) --- tests/upgrade/raycluster_sdk_upgrade_test.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/upgrade/raycluster_sdk_upgrade_test.py b/tests/upgrade/raycluster_sdk_upgrade_test.py index fb160be13..235383f65 100644 --- a/tests/upgrade/raycluster_sdk_upgrade_test.py +++ b/tests/upgrade/raycluster_sdk_upgrade_test.py @@ -82,19 +82,18 @@ def run_mnist_raycluster_sdk_oauth(self): class TestMnistJobSubmit: def setup_method(self): initialize_kubernetes_client(self) - self.namespace = namespace - self.cluster = get_cluster("mnist", self.namespace) - if not self.cluster: - raise RuntimeError("TestRayClusterUp needs to be run before this test") - - def test_mnist_job_submission(self): auth = TokenAuthentication( token=run_oc_command(["whoami", "--show-token=true"]), server=run_oc_command(["whoami", "--show-server=true"]), skip_tls=True, ) auth.login() + self.namespace = namespace + self.cluster = get_cluster("mnist", self.namespace) + if not self.cluster: + raise RuntimeError("TestRayClusterUp needs to be run before this test") + def test_mnist_job_submission(self): self.assert_jobsubmit_withoutLogin(self.cluster) self.assert_jobsubmit_withlogin(self.cluster)