Skip to content

Commit aca5493

Browse files
committed
update: tests
1 parent 39213b2 commit aca5493

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

tests/e2e/mnist_raycluster_sdk_oauth_test.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from time import sleep
44

5-
from torchx.specs.api import AppState, is_terminal
6-
75
from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication
86
from codeflare_sdk.job import RayJobClient
97

@@ -78,7 +76,7 @@ def assert_jobsubmit_withoutLogin(self, cluster):
7876
"entrypoint": "python mnist.py",
7977
"runtime_env": {
8078
"working_dir": "./tests/e2e/",
81-
"pip": "mnist_pip_requirements.txt",
79+
"pip": "./tests/e2e/mnist_pip_requirements.txt",
8280
},
8381
}
8482
try:
@@ -116,7 +114,7 @@ def assert_jobsubmit_withlogin(self, cluster):
116114
timeout = 900
117115
while not done:
118116
status = client.get_job_status(submission_id)
119-
if is_terminal(status.state):
117+
if status.is_terminal():
120118
break
121119
if not done:
122120
print(status)
@@ -151,9 +149,9 @@ def assert_appwrapper_exists(self):
151149
assert False
152150

153151
def assert_job_completion(self, status):
154-
if status.state == AppState.SUCCEEDED:
155-
print(f"Job has completed: '{status.state}'")
152+
if status == "SUCCEEDED":
153+
print(f"Job has completed: '{status}'")
156154
assert True
157155
else:
158-
print(f"Job has completed: '{status.state}'")
156+
print(f"Job has completed: '{status}'")
159157
assert False

tests/e2e/mnist_raycluster_sdk_test.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
import ray
99

10-
from torchx.specs.api import AppState, is_terminal
11-
1210
from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
1311
from codeflare_sdk.job import RayJobClient
1412

@@ -69,7 +67,6 @@ def run_mnist_raycluster_sdk(self):
6967
num_gpus=0,
7068
instascale=False,
7169
image=ray_image,
72-
ingress_domain="apps.cluster.awsroute.org",
7370
ingress_options=ingress_options,
7471
write_to_file=True,
7572
)
@@ -97,7 +94,7 @@ def run_mnist_raycluster_sdk(self):
9794
entrypoint="python mnist.py",
9895
runtime_env={
9996
"working_dir": "./tests/e2e/",
100-
"pip": "mnist_pip_requirements.txt",
97+
"pip": "./tests/e2e/mnist_pip_requirements.txt",
10198
},
10299
)
103100
print(f"Submitted job with ID: {submission_id}")
@@ -106,7 +103,7 @@ def run_mnist_raycluster_sdk(self):
106103
timeout = 900
107104
while not done:
108105
status = client.get_job_status(submission_id)
109-
if is_terminal(status.state):
106+
if status.is_terminal():
110107
break
111108
if not done:
112109
print(status)
@@ -155,9 +152,9 @@ def assert_raycluster_exists(self):
155152
assert False
156153

157154
def assert_job_completion(self, status):
158-
if status.state == AppState.SUCCEEDED:
159-
print(f"Job has completed: '{status.state}'")
155+
if status == "SUCCEEDED":
156+
print(f"Job has completed: '{status}'")
160157
assert True
161158
else:
162-
print(f"Job has completed: '{status.state}'")
159+
print(f"Job has completed: '{status}'")
163160
assert False

tests/e2e/mnist_rayjob.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
from time import sleep
44

5-
from torchx.specs.api import AppState, is_terminal
6-
75
from support import *
86

97
from codeflare_sdk.cluster.cluster import get_cluster
@@ -31,7 +29,7 @@
3129
timeout = 900
3230
while not done:
3331
status = client.get_job_status(submission_id)
34-
if is_terminal(status.state):
32+
if status.is_terminal():
3533
break
3634
if not done:
3735
print(status)
@@ -47,7 +45,7 @@
4745
cluster.down()
4846

4947

50-
if not status.state == AppState.SUCCEEDED:
48+
if not status == "SUCCEEDED":
5149
exit(1)
5250
else:
5351
exit(0)

0 commit comments

Comments
 (0)