@@ -95,6 +95,13 @@ func runMnistRayJobRayCluster(t *testing.T, accelerator string, numberOfGpus int
95
95
// Assert the Ray job has completed successfully
96
96
test .Expect (GetRayJob (test , rayJob .Namespace , rayJob .Name )).
97
97
To (WithTransform (RayJobStatus , Equal (rayv1 .JobStatusSucceeded )))
98
+
99
+ test .T ().Logf ("Deleting RayCluster %s/%s" , rayCluster .Namespace , rayCluster .Name )
100
+ err = test .Client ().Ray ().RayV1 ().RayClusters (namespace .Name ).Delete (test .Ctx (), rayCluster .Name , metav1.DeleteOptions {})
101
+ test .Expect (err ).NotTo (HaveOccurred ())
102
+
103
+ test .T ().Logf ("Waiting for RayCluster %s/%s to be deleted" , rayCluster .Namespace , rayCluster .Name )
104
+ test .Eventually (RayClusters (test , namespace .Name ), TestTimeoutLong ).Should (BeEmpty ())
98
105
}
99
106
100
107
func TestMnistRayJobRayClusterAppWrapperCpu (t * testing.T ) {
@@ -143,11 +150,13 @@ func runMnistRayJobRayClusterAppWrapper(t *testing.T, accelerator string, number
143
150
awMap , err := runtime .DefaultUnstructuredConverter .ToUnstructured (aw )
144
151
test .Expect (err ).NotTo (HaveOccurred ())
145
152
unstruct := unstructured.Unstructured {Object : awMap }
146
- _ , err = test .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace .Name ).Create (test .Ctx (), & unstruct , metav1.CreateOptions {})
153
+ unstructp , err := test .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace .Name ).Create (test .Ctx (), & unstruct , metav1.CreateOptions {})
154
+ test .Expect (err ).NotTo (HaveOccurred ())
155
+ err = runtime .DefaultUnstructuredConverter .FromUnstructured (unstructp .Object , aw )
147
156
test .Expect (err ).NotTo (HaveOccurred ())
148
- test .T ().Logf ("Created AppWrapper %s/%s successfully" , aw .Namespace , aw .GenerateName )
157
+ test .T ().Logf ("Created AppWrapper %s/%s successfully" , aw .Namespace , aw .Name )
149
158
150
- test .T ().Logf ("Waiting for AppWrapper %s/%s to be running" , aw .Namespace , aw .GenerateName )
159
+ test .T ().Logf ("Waiting for AppWrapper %s/%s to be running" , aw .Namespace , aw .Name )
151
160
test .Eventually (AppWrappers (test , namespace ), TestTimeoutMedium ).
152
161
Should (ContainElement (WithTransform (AppWrapperPhase , Equal (mcadv1beta2 .AppWrapperRunning ))))
153
162
@@ -180,6 +189,17 @@ func runMnistRayJobRayClusterAppWrapper(t *testing.T, accelerator string, number
180
189
// Assert the Ray job has completed successfully
181
190
test .Expect (GetRayJob (test , rayJob .Namespace , rayJob .Name )).
182
191
To (WithTransform (RayJobStatus , Equal (rayv1 .JobStatusSucceeded )))
192
+
193
+ // Assert the AppWrapper has completed successfully
194
+ test .Expect (AppWrappers (test , namespace )(test )).
195
+ To (ContainElement (WithTransform (AppWrapperPhase , Equal (mcadv1beta2 .AppWrapperSucceeded ))))
196
+
197
+ test .T ().Logf ("Deleting AppWrapper %s/%s" , aw .Namespace , aw .Name )
198
+ err = test .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace .Name ).Delete (test .Ctx (), aw .Name , metav1.DeleteOptions {})
199
+ test .Expect (err ).NotTo (HaveOccurred ())
200
+
201
+ test .T ().Logf ("Waiting for AppWrapper %s/%s to be deleted" , aw .Namespace , aw .Name )
202
+ test .Eventually (AppWrappers (test , namespace ), TestTimeoutLong ).Should (BeEmpty ())
183
203
}
184
204
185
205
func constructMNISTConfigMap (test Test , namespace * corev1.Namespace ) * corev1.ConfigMap {
0 commit comments