@@ -218,20 +218,37 @@ wait_for_oidc_endpoint_docker() {
218218calculate_rabbitmq_url () {
219219 echo " ${RABBITMQ_SCHEME:- http} ://$1 ${PUBLIC_RABBITMQ_PATH:- $RABBITMQ_PATH } "
220220}
221-
221+ calculate_forward_proxy_url () {
222+ PROXIED_URL=$1
223+ PROXY_HOSTNAME=$2
224+ PROXY_PORT=$3
225+ SCHEME=$( echo " $PROXIED_URL " | cut -d: -f1)
226+ PATH=$( echo " $PROXIED_URL " | cut -d/ -f4-)
227+ echo " $SCHEME ://$PROXY_HOSTNAME :$PROXY_PORT /$PATH "
228+ }
222229wait_for_url () {
223230 BASE_URL=$1
224231 if [[ $BASE_URL == * " localhost" ** ]]; then
225- wait_for_url_local $BASE_URL
232+ wait_for_url_local $@
226233 else
227- wait_for_url_docker $BASE_URL
234+ wait_for_url_docker $@
228235 fi
229236}
230237wait_for_url_local () {
231238 url=$1
239+ proxy=${2:- none}
240+ proxy_user=${3:- none}
241+ proxy_pass=$4
242+ curl_args=" -L -f -v"
232243 max_retry=10
233244 counter=0
234- until (curl -L -f -v $url > /dev/null 2>&1 )
245+ if [[ " $proxy " != " none" && " $proxy " != " " ]]; then
246+ curl_args=" --proxy ${proxy} ${curl_args} "
247+ fi
248+ if [[ " $proxy_user " != " none" && " $proxy_user " != " " ]]; then
249+ curl_args=" --proxy-user ${proxy_user} :${proxy_pass} ${curl_args} "
250+ fi
251+ until (curl $curl_args $url > /dev/null 2>&1 )
235252 do
236253 print " Waiting for $url to start (local)"
237254 sleep 5
@@ -242,9 +259,19 @@ wait_for_url_local() {
242259}
243260wait_for_url_docker () {
244261 url=$1
262+ proxy=${2:- none}
263+ proxy_user=${3:- none}
264+ proxy_pass=$4
245265 max_retry=10
246266 counter=0
247- until (docker run --net ${DOCKER_NETWORK} --rm curlimages/curl:7.85.0 -L -f -v $url > /dev/null 2>&1 )
267+ curl_args=" -L -f -v"
268+ if [[ " $proxy " != " none" && " $proxy " != " " ]]; then
269+ curl_args=" --proxy ${proxy} ${curl_args} "
270+ fi
271+ if [[ " $proxy_user " != " none" && " $proxy_user " != " " ]]; then
272+ curl_args=" --proxy-user ${proxy_user} :${proxy_pass} ${curl_args} "
273+ fi
274+ until (docker run --net ${DOCKER_NETWORK} --rm curlimages/curl:7.85.0 $curl_args $url > /dev/null 2>&1 )
248275 do
249276 print " Waiting for $url to start (docker)"
250277 sleep 5
@@ -377,7 +404,8 @@ profiles_with_local_or_docker() {
377404generate_env_file () {
378405 begin " Generating env file ..."
379406 mkdir -p $CONF_DIR
380- ${BIN_DIR} /gen-env-file $TEST_CONFIG_DIR $ENV_FILE
407+ ${BIN_DIR} /gen-env-file $TEST_CONFIG_DIR ${ENV_FILE} .tmp
408+ grep -v ' ^#' ${ENV_FILE} .tmp > $ENV_FILE
381409 source $ENV_FILE
382410 end " Finished generating env file."
383411}
@@ -560,7 +588,7 @@ run_on_docker_with() {
560588 build_mocha_image
561589 start_selenium
562590
563- trap teardown_components EXIT
591+ trap " teardown_components" EXIT
564592
565593 start_components
566594 test
@@ -641,7 +669,6 @@ start_components() {
641669 $start
642670 done
643671}
644-
645672teardown_components () {
646673 skip_rabbitmq=${1:- false}
647674
0 commit comments