Skip to content

Commit 8de09c4

Browse files
authored
Wait until cuda builds are Completed in deployment test (#452)
* Wait until cuda builds are Completed in deployment test Signed-off-by: Jorge Garcia Oncins <[email protected]> * Improve kw "Wait Until All Builds Are Complete" and use it in ODS-480 Signed-off-by: Jorge Garcia Oncins <[email protected]> * Remove not needed call to Verify All Builds Are Complete Signed-off-by: Jorge Garcia Oncins <[email protected]>
1 parent 2058746 commit 8de09c4

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

tests/Resources/ODS.robot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,4 +399,3 @@ Delete RHODS Config Map
399399
... corresponding argument
400400
[Arguments] ${name} ${namespace}=redhat-ods-applications
401401
OpenShiftLibrary.Oc Delete kind=ConfigMap name=${name} namespace=${namespace}
402-

tests/Resources/Page/OCPDashboard/Builds/Builds.robot

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,31 @@ Wait Until Build Status Is
8080
... Build Status Should Be ${namespace} ${build_name} ${expected_status}
8181

8282
Wait Until All Builds Are Complete
83-
[Documentation] Waits until all the builds are in Complete State
84-
[Arguments] ${namespace}
83+
[Documentation] Obtains the list of builds in ${namespace} and, for each of
84+
... them, fails if state is Failed or Error. If not, waits until state
85+
... is Complete or ${build_timeout} is reached
86+
[Arguments] ${namespace} ${build_timeout}=20 min
8587
${builds_data} = Oc Get kind=Build namespace=${namespace}
8688
FOR ${build_data} IN @{builds_data}
87-
Wait Until Build Status Is namespace=${namespace} build_name=${build_data['metadata']['name']} expected_status=Complete
89+
${build_name} = Set Variable ${build_data['metadata']['name']}
90+
${build_status} = Set Variable ${build_data['status']['phase']}
91+
IF "${build_status}" == "Failed" or "${build_status}" == "Error"
92+
Fail msg=Build ${build_name} is in ${build_status} state
93+
ELSE
94+
Wait Until Build Status Is namespace=${namespace} build_name=${build_name}
95+
... expected_status=Complete timeout=${build_timeout}
96+
END
97+
END
98+
99+
Verify All Builds Are Complete
100+
[Documentation] Verify all Builds in a namespace have status as Complete
101+
[Arguments] ${namespace}
102+
${builds_data} = Oc Get kind=Build namespace=${namespace}
103+
FOR ${build_data} IN @{builds_data}
104+
${build_name} = Set Variable ${build_data['metadata']['name']}
105+
${build_status} = Set Variable ${build_data['status']['phase']}
106+
Should Be Equal As Strings ${build_status} Complete
107+
... msg=Build ${build_name} is not in Complete status
88108
END
89109

90110
Provoke Image Build Failure
@@ -141,4 +161,4 @@ Rebuild Missing Or Failed Builds
141161
END
142162
Wait Until Build Status Is namespace=${namespace} build_name=${build_name}
143163
... expected_status=Complete
144-
END
164+
END

tests/Tests/100__deploy/100__installation/102__post_install.robot

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Suite Setup RHOSi Setup
1818
Resource ../../../Resources/Page/HybridCloudConsole/HCCLogin.robot
1919
Resource ../../../Resources/Common.robot
2020

21+
2122
*** Test Cases ***
2223
Verify Traefik Deployment
2324
[Documentation] Verifies RHODS Traefik deployment
@@ -123,10 +124,11 @@ Verify Oath-Proxy Image Is fetched From CPaaS
123124
Verify Pytorch And Tensorflow Can Be Spawned
124125
[Documentation] Check Cuda builds are complete and Verify Pytorch and Tensorflow can be spawned
125126
[Tags] Sanity
127+
... Tier1
126128
... ODS-480 ODS-481
127-
Verify Cuda Builds Are Completed
128-
Verify Image Can Be Spawned image=pytorch size=Default
129-
Verify Image Can Be Spawned image=tensorflow size=Default
129+
Wait Until All Builds Are Complete namespace=redhat-ods-applications
130+
Verify Image Can Be Spawned image=pytorch size=Default
131+
Verify Image Can Be Spawned image=tensorflow size=Default
130132

131133
Verify That Blackbox-exporter Is Protected With Auth-proxy
132134
[Documentation] Vrifies the blackbok-exporter inludes 2 containers one for application and second for oauth proxy
@@ -218,20 +220,6 @@ Verify Monitoring Stack Is Reconciled Without Restarting The ODS Operator
218220

219221

220222
*** Keywords ***
221-
Verify Cuda Builds Are Completed
222-
[Documentation] Verify All Cuda Builds have status as Complete
223-
${Pods} = Run oc get build -n redhat-ods-applications
224-
@{builds} = Split String ${Pods} \n
225-
${len} = Get Length ${builds}
226-
FOR ${ind} IN RANGE 1 ${len}
227-
@{pre} = Split String ${builds}[${ind}]
228-
${is_cuda_build} = Run Keyword And Return Status Should Contain ${pre}[0] cuda
229-
IF ${is_cuda_build} == True
230-
Should Be Equal As Strings ${pre}[3] Complete
231-
END
232-
Should Be Equal As Strings ${pre}[3] Complete
233-
END
234-
235223
Verify Authentication Is Required To Access BlackboxExporter
236224
[Documentation] Verifies authentication is required to access blackbox exporter. To do so,
237225
... runs the curl command from the prometheus container trying to access a blacbox-exporter target.
@@ -329,5 +317,3 @@ Verify Requests Contains Expected Values
329317
[Arguments] ${cpu} ${memory} ${requests}
330318
Should Be Equal As Strings ${requests['cpu']} ${cpu}
331319
Should Be Equal As Strings ${requests['memory']} ${memory}
332-
333-

0 commit comments

Comments
 (0)