Skip to content

Commit

Permalink
Wait until cuda builds are Completed in deployment test (#452)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
jgarciao authored Jul 11, 2022
1 parent 2058746 commit 8de09c4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
1 change: 0 additions & 1 deletion tests/Resources/ODS.robot
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,3 @@ Delete RHODS Config Map
... corresponding argument
[Arguments] ${name} ${namespace}=redhat-ods-applications
OpenShiftLibrary.Oc Delete kind=ConfigMap name=${name} namespace=${namespace}

28 changes: 24 additions & 4 deletions tests/Resources/Page/OCPDashboard/Builds/Builds.robot
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,31 @@ Wait Until Build Status Is
... Build Status Should Be ${namespace} ${build_name} ${expected_status}

Wait Until All Builds Are Complete
[Documentation] Waits until all the builds are in Complete State
[Arguments] ${namespace}
[Documentation] Obtains the list of builds in ${namespace} and, for each of
... them, fails if state is Failed or Error. If not, waits until state
... is Complete or ${build_timeout} is reached
[Arguments] ${namespace} ${build_timeout}=20 min
${builds_data} = Oc Get kind=Build namespace=${namespace}
FOR ${build_data} IN @{builds_data}
Wait Until Build Status Is namespace=${namespace} build_name=${build_data['metadata']['name']} expected_status=Complete
${build_name} = Set Variable ${build_data['metadata']['name']}
${build_status} = Set Variable ${build_data['status']['phase']}
IF "${build_status}" == "Failed" or "${build_status}" == "Error"
Fail msg=Build ${build_name} is in ${build_status} state
ELSE
Wait Until Build Status Is namespace=${namespace} build_name=${build_name}
... expected_status=Complete timeout=${build_timeout}
END
END

Verify All Builds Are Complete
[Documentation] Verify all Builds in a namespace have status as Complete
[Arguments] ${namespace}
${builds_data} = Oc Get kind=Build namespace=${namespace}
FOR ${build_data} IN @{builds_data}
${build_name} = Set Variable ${build_data['metadata']['name']}
${build_status} = Set Variable ${build_data['status']['phase']}
Should Be Equal As Strings ${build_status} Complete
... msg=Build ${build_name} is not in Complete status
END

Provoke Image Build Failure
Expand Down Expand Up @@ -141,4 +161,4 @@ Rebuild Missing Or Failed Builds
END
Wait Until Build Status Is namespace=${namespace} build_name=${build_name}
... expected_status=Complete
END
END
24 changes: 5 additions & 19 deletions tests/Tests/100__deploy/100__installation/102__post_install.robot
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Suite Setup RHOSi Setup
Resource ../../../Resources/Page/HybridCloudConsole/HCCLogin.robot
Resource ../../../Resources/Common.robot


*** Test Cases ***
Verify Traefik Deployment
[Documentation] Verifies RHODS Traefik deployment
Expand Down Expand Up @@ -123,10 +124,11 @@ Verify Oath-Proxy Image Is fetched From CPaaS
Verify Pytorch And Tensorflow Can Be Spawned
[Documentation] Check Cuda builds are complete and Verify Pytorch and Tensorflow can be spawned
[Tags] Sanity
... Tier1
... ODS-480 ODS-481
Verify Cuda Builds Are Completed
Verify Image Can Be Spawned image=pytorch size=Default
Verify Image Can Be Spawned image=tensorflow size=Default
Wait Until All Builds Are Complete namespace=redhat-ods-applications
Verify Image Can Be Spawned image=pytorch size=Default
Verify Image Can Be Spawned image=tensorflow size=Default

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


*** Keywords ***
Verify Cuda Builds Are Completed
[Documentation] Verify All Cuda Builds have status as Complete
${Pods} = Run oc get build -n redhat-ods-applications
@{builds} = Split String ${Pods} \n
${len} = Get Length ${builds}
FOR ${ind} IN RANGE 1 ${len}
@{pre} = Split String ${builds}[${ind}]
${is_cuda_build} = Run Keyword And Return Status Should Contain ${pre}[0] cuda
IF ${is_cuda_build} == True
Should Be Equal As Strings ${pre}[3] Complete
END
Should Be Equal As Strings ${pre}[3] Complete
END

Verify Authentication Is Required To Access BlackboxExporter
[Documentation] Verifies authentication is required to access blackbox exporter. To do so,
... runs the curl command from the prometheus container trying to access a blacbox-exporter target.
Expand Down Expand Up @@ -329,5 +317,3 @@ Verify Requests Contains Expected Values
[Arguments] ${cpu} ${memory} ${requests}
Should Be Equal As Strings ${requests['cpu']} ${cpu}
Should Be Equal As Strings ${requests['memory']} ${memory}


0 comments on commit 8de09c4

Please sign in to comment.