Skip to content

Commit 190096c

Browse files
Merge pull request #211 from ashu-011/debug_mode
Add Horizontest debug mode for test-operator
2 parents 3a65137 + 85bc0dc commit 190096c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

container-images/tcib/base/os/horizontest/run_horizontest.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ GROUP_NAME=admins
1616
SELENIUM_EXPLICIT_WAIT=180
1717
SELENIUM_PAGE_TIMEOUT=120
1818
SELENIUM_IMPLICIT_WAIT=30
19+
HORIZONTEST_DEBUG_MODE="${HORIZONTEST_DEBUG_MODE:-false}"
1920

2021
# assert mandatory variables have been set
2122
[[ -z ${ADMIN_USERNAME} ]] && echo "ADMIN_USERNAME not set" && exit 1
@@ -25,6 +26,16 @@ SELENIUM_IMPLICIT_WAIT=30
2526
[[ -z ${REPO_URL} ]] && REPO_URL="https://review.opendev.org/openstack/horizon"
2627
[[ -z ${HORIZON_REPO_BRANCH} ]] && HORIZON_REPO_BRANCH="master"
2728

29+
function catch_error_if_debug {
30+
echo "File run_horizontest.sh has run into an error!"
31+
sleep infinity
32+
}
33+
34+
# Catch errors when in debug mode
35+
if [ ${HORIZONTEST_DEBUG_MODE} == true ]; then
36+
trap catch_error_if_debug ERR
37+
fi
38+
2839
#This function is temporarily added until tempest cleanup is implemented
2940
function clean_leftover_images {
3041
openstack image list -c Name -f value --os-cloud default | xargs -I {} openstack image delete {} --os-cloud default
@@ -141,4 +152,9 @@ cp -rf ${HORIZONTEST_DIR}/horizon/test_reports/* ${LOG_DIR}
141152

142153
delete_custom_resources
143154

155+
# Keep pod in running state when in debug mode
156+
if [ ${HORIZONTEST_DEBUG_MODE} == true ]; then
157+
sleep infinity
158+
fi
159+
144160
exit ${RETURN_VALUE}

0 commit comments

Comments
 (0)