@@ -57,7 +57,7 @@ def run_mnist_raycluster_sdk_oauth(self):
57
57
cluster .up ()
58
58
cluster .status ()
59
59
# wait for raycluster to be Ready
60
- # cluster.wait_ready() # temporarily broken
60
+ # cluster.wait_ready() #temporarily broken
61
61
sleep (60 )
62
62
cluster .status ()
63
63
# Check cluster details
@@ -98,27 +98,16 @@ def test_mnist_job_submission(self):
98
98
# Assertions
99
99
def assert_jobsubmit_withoutLogin (self , cluster ):
100
100
dashboard_url = cluster .cluster_dashboard_uri ()
101
- jobdata = {
102
- "entrypoint" : "python mnist.py" ,
103
- "runtime_env" : {
104
- "working_dir" : "./tests/e2e/" ,
105
- "pip" : "./tests/e2e/mnist_pip_requirements.txt" ,
106
- },
107
- }
108
101
try :
109
- response = requests . post (
110
- dashboard_url + "/api/jobs/" , verify = False , json = jobdata
111
- )
112
- if response .status_code == 403 :
102
+ RayJobClient ( address = dashboard_url , verify = False )
103
+ assert False
104
+ except Exception as e :
105
+ if e . response .status_code == 403 :
113
106
assert True
114
107
else :
115
- response . raise_for_status ( )
108
+ print ( f"An unexpected error occurred. Error: { e } " )
116
109
assert False
117
110
118
- except Exception as e :
119
- print (f"An unexpected error occurred. Error: { e } " )
120
- assert False
121
-
122
111
def assert_jobsubmit_withlogin (self , cluster ):
123
112
auth_token = run_oc_command (["whoami" , "--show-token=true" ])
124
113
ray_dashboard = cluster .cluster_dashboard_uri ()
0 commit comments