2021-04-03 18:18:50 -04:00
|
|
|
# This script is sourced by CI scripts to launch httpbin.
|
|
|
|
#
|
|
|
|
# Do not run it directly.
|
|
|
|
|
|
|
|
httpbin_launch() {
|
2021-05-16 17:00:16 -04:00
|
|
|
WX_TEST_WEBREQUEST_URL=0
|
|
|
|
export WX_TEST_WEBREQUEST_URL
|
|
|
|
|
2021-04-03 18:18:50 -04:00
|
|
|
echo 'Launching httpbin...'
|
|
|
|
|
2022-08-17 15:15:42 -04:00
|
|
|
# Installing Flask 2.1.0 and its dependency Werkzeug 2.1.0 results
|
|
|
|
# in failures when trying to run httpbin, so stick to an older but
|
|
|
|
# working version.
|
|
|
|
pip_explicit_deps='Flask==2.0.3 Werkzeug==2.0.3'
|
2021-04-03 18:18:50 -04:00
|
|
|
|
2023-08-23 17:16:56 -04:00
|
|
|
python3 -m pip install $pip_explicit_deps 'httpbin==0.7.0' --user
|
2022-04-17 12:48:12 -04:00
|
|
|
python3 -m httpbin.core --port 50500 2>&1 >httpbin.log &
|
|
|
|
WX_TEST_WEBREQUEST_URL="http://localhost:50500"
|
2021-04-03 18:18:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
httpbin_show_log() {
|
2021-05-16 17:00:16 -04:00
|
|
|
if [ "$WX_TEST_WEBREQUEST_URL" != "0" ]; then
|
|
|
|
echo '*** Tests failed, contents of httpbin.log follows: ***'
|
|
|
|
echo '-----------------------------------------------------------'
|
|
|
|
cat httpbin.log
|
|
|
|
echo '-----------------------------------------------------------'
|
|
|
|
fi
|
2021-04-03 18:18:50 -04:00
|
|
|
}
|