Skip to content

Commit ed2d7d9

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

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

tests/e2e/mnist_raycluster_sdk_oauth_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def assert_jobsubmit_withoutLogin(self, cluster):
7878
"entrypoint": "python mnist.py",
7979
"runtime_env": {
8080
"working_dir": "./tests/e2e/",
81-
"pip": "mnist_pip_requirements.txt",
81+
"pip": "./tests/e2e/mnist_pip_requirements.txt",
8282
},
8383
}
8484
try:
@@ -116,7 +116,7 @@ def assert_jobsubmit_withlogin(self, cluster):
116116
timeout = 900
117117
while not done:
118118
status = client.get_job_status(submission_id)
119-
if is_terminal(status.state):
119+
if status.is_terminal():
120120
break
121121
if not done:
122122
print(status)
@@ -151,9 +151,9 @@ def assert_appwrapper_exists(self):
151151
assert False
152152

153153
def assert_job_completion(self, status):
154-
if status.state == AppState.SUCCEEDED:
155-
print(f"Job has completed: '{status.state}'")
154+
if status == AppState.SUCCEEDED:
155+
print(f"Job has completed: '{status}'")
156156
assert True
157157
else:
158-
print(f"Job has completed: '{status.state}'")
158+
print(f"Job has completed: '{status}'")
159159
assert False

tests/e2e/mnist_raycluster_sdk_test.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import ray
99

10-
from torchx.specs.api import AppState, is_terminal
10+
from torchx.specs.api import AppState
1111

1212
from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
1313
from codeflare_sdk.job import RayJobClient
@@ -69,7 +69,6 @@ def run_mnist_raycluster_sdk(self):
6969
num_gpus=0,
7070
instascale=False,
7171
image=ray_image,
72-
ingress_domain="apps.cluster.awsroute.org",
7372
ingress_options=ingress_options,
7473
write_to_file=True,
7574
)
@@ -97,7 +96,7 @@ def run_mnist_raycluster_sdk(self):
9796
entrypoint="python mnist.py",
9897
runtime_env={
9998
"working_dir": "./tests/e2e/",
100-
"pip": "mnist_pip_requirements.txt",
99+
"pip": "./tests/e2e/mnist_pip_requirements.txt",
101100
},
102101
)
103102
print(f"Submitted job with ID: {submission_id}")
@@ -106,7 +105,7 @@ def run_mnist_raycluster_sdk(self):
106105
timeout = 900
107106
while not done:
108107
status = client.get_job_status(submission_id)
109-
if is_terminal(status.state):
108+
if status.is_terminal():
110109
break
111110
if not done:
112111
print(status)
@@ -155,9 +154,9 @@ def assert_raycluster_exists(self):
155154
assert False
156155

157156
def assert_job_completion(self, status):
158-
if status.state == AppState.SUCCEEDED:
159-
print(f"Job has completed: '{status.state}'")
157+
if status == AppState.SUCCEEDED:
158+
print(f"Job has completed: '{status}'")
160159
assert True
161160
else:
162-
print(f"Job has completed: '{status.state}'")
161+
print(f"Job has completed: '{status}'")
163162
assert False

tests/e2e/mnist_rayjob.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from time import sleep
44

5-
from torchx.specs.api import AppState, is_terminal
5+
from torchx.specs.api import AppState
66

77
from support import *
88

@@ -31,7 +31,7 @@
3131
timeout = 900
3232
while not done:
3333
status = client.get_job_status(submission_id)
34-
if is_terminal(status.state):
34+
if status.is_terminal():
3535
break
3636
if not done:
3737
print(status)
@@ -47,7 +47,7 @@
4747
cluster.down()
4848

4949

50-
if not status.state == AppState.SUCCEEDED:
50+
if not status == AppState.SUCCEEDED:
5151
exit(1)
5252
else:
5353
exit(0)

0 commit comments

Comments
 (0)