wxWidgets/build/tools/httpbin.sh
Scott Talbert e676c621d4 CI: fix/simplify httpbin use by standardizing Python version
Now that we don't use Travis CI any longer (and don't use httpbin on the
other CI providers yet), we can make our life much simpler by just using
Python 3.10 on all platforms instead of trying to find version-specific
workarounds for various python/pip/httpbin incompatibilities.

Closes #22726.

(cherry picked from commit 458dc814c241066323858182e55d2186d396c09d)
2022-08-18 21:56:36 +02:00

29 lines
923 B
Bash

# This script is sourced by CI scripts to launch httpbin.
#
# Do not run it directly.
httpbin_launch() {
WX_TEST_WEBREQUEST_URL=0
export WX_TEST_WEBREQUEST_URL
echo 'Launching httpbin...'
# 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'
python3 -m pip install $pip_explicit_deps httpbin --user
python3 -m httpbin.core --port 50500 2>&1 >httpbin.log &
WX_TEST_WEBREQUEST_URL="http://localhost:50500"
}
httpbin_show_log() {
if [ "$WX_TEST_WEBREQUEST_URL" != "0" ]; then
echo '*** Tests failed, contents of httpbin.log follows: ***'
echo '-----------------------------------------------------------'
cat httpbin.log
echo '-----------------------------------------------------------'
fi
}