Disable wxWebRequest tests on CI platforms without Python 3
This currently means macOS 10.11 only, which is only used on Travis CI and Python 2 installation there is broken anyhow, so this doesn't make anything worse than it already is.
This commit is contained in:
@@ -3,6 +3,15 @@
|
|||||||
# Do not run it directly.
|
# Do not run it directly.
|
||||||
|
|
||||||
httpbin_launch() {
|
httpbin_launch() {
|
||||||
|
WX_TEST_WEBREQUEST_URL=0
|
||||||
|
export WX_TEST_WEBREQUEST_URL
|
||||||
|
|
||||||
|
# We need python3 for httpbin, python2 can't be used any longer.
|
||||||
|
if ! command -v python3 > /dev/null; then
|
||||||
|
echo 'Python 3 is not available, not using httpbin.'
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
echo 'Launching httpbin...'
|
echo 'Launching httpbin...'
|
||||||
|
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
@@ -17,9 +26,6 @@ httpbin_launch() {
|
|||||||
|
|
||||||
case "$dist_codename" in
|
case "$dist_codename" in
|
||||||
trusty)
|
trusty)
|
||||||
# Python 2.7.6 is too old to support SNI and can't be used.
|
|
||||||
PY3=3
|
|
||||||
|
|
||||||
# Explicitly select the versions of dependencies that are still
|
# Explicitly select the versions of dependencies that are still
|
||||||
# compatible with Python 3.4 used here as the latest versions of
|
# compatible with Python 3.4 used here as the latest versions of
|
||||||
# several of them are not.
|
# several of them are not.
|
||||||
@@ -33,14 +39,8 @@ httpbin_launch() {
|
|||||||
# and decorator >= 5 is incompatible with it too.
|
# and decorator >= 5 is incompatible with it too.
|
||||||
pip_explicit_deps='decorator==4.4.2'
|
pip_explicit_deps='decorator==4.4.2'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
|
||||||
# Elsewhere just use Python 3.
|
|
||||||
PY3=3
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$PY3" = 3 ]; then
|
|
||||||
# Ensure that we have at least some version of pip.
|
# Ensure that we have at least some version of pip.
|
||||||
if ! python3 -m pip; then
|
if ! python3 -m pip; then
|
||||||
sudo apt-get -q -o=Dpkg::Use-Pty=0 install python3-pip
|
sudo apt-get -q -o=Dpkg::Use-Pty=0 install python3-pip
|
||||||
@@ -54,20 +54,19 @@ httpbin_launch() {
|
|||||||
# it may not support Python version that we actually have (this one
|
# it may not support Python version that we actually have (this one
|
||||||
# still works with 3.4, 20.0.1 is the last one to support 3.5).
|
# still works with 3.4, 20.0.1 is the last one to support 3.5).
|
||||||
python3 -m pip install --user --upgrade pip==19.1.1
|
python3 -m pip install --user --upgrade pip==19.1.1
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Installing using `python$PY3 -m pip --version`"
|
echo "Installing using `python3 -m pip --version`"
|
||||||
|
|
||||||
python$PY3 -m pip install $pip_explicit_deps httpbin --user
|
python3 -m pip install $pip_explicit_deps httpbin --user
|
||||||
python$PY3 -m httpbin.core 2>&1 >httpbin.log &
|
python3 -m httpbin.core 2>&1 >httpbin.log &
|
||||||
WX_TEST_WEBREQUEST_URL="http://localhost:5000"
|
WX_TEST_WEBREQUEST_URL="http://localhost:5000"
|
||||||
|
|
||||||
export WX_TEST_WEBREQUEST_URL
|
|
||||||
}
|
}
|
||||||
|
|
||||||
httpbin_show_log() {
|
httpbin_show_log() {
|
||||||
|
if [ "$WX_TEST_WEBREQUEST_URL" != "0" ]; then
|
||||||
echo '*** Tests failed, contents of httpbin.log follows: ***'
|
echo '*** Tests failed, contents of httpbin.log follows: ***'
|
||||||
echo '-----------------------------------------------------------'
|
echo '-----------------------------------------------------------'
|
||||||
cat httpbin.log
|
cat httpbin.log
|
||||||
echo '-----------------------------------------------------------'
|
echo '-----------------------------------------------------------'
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user