From 32cdda65bb6e00a84e48461699b5fd31dce6267d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Jan 2021 15:38:48 +0100 Subject: [PATCH] Use pip for httpbin in Mac Travis CI builds Docker isn't available under Mac, unfortunately. Notice that it's still better to use Docker if it is available, rather than using pip everywhere, as pip has trouble installing httpbin in the Ubuntu 14.04 build, for example. --- build/tools/travis-ci.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/build/tools/travis-ci.sh b/build/tools/travis-ci.sh index 1c07d12bdf..a91947b1dc 100755 --- a/build/tools/travis-ci.sh +++ b/build/tools/travis-ci.sh @@ -14,10 +14,21 @@ export NO_AT_BRIDGE=1 launch_httpbin() { echo 'travis_fold:start:httpbin' - echo 'Running httpbin container...' - docker pull kennethreitz/httpbin - docker run -d -p 80:80 kennethreitz/httpbin - WX_TEST_WEBREQUEST_URL="http://localhost" + echo 'Running httpbin...' + + # Prefer to use docker if it's available as it's more robust than dealing + # with pip -- but we need to have a fallback as at least Mac builds don't + # have docker. + if command -v docker; then + docker pull kennethreitz/httpbin + docker run -d -p 80:80 kennethreitz/httpbin + WX_TEST_WEBREQUEST_URL="http://localhost" + else + pip install httpbin + python -m httpbin.core & + WX_TEST_WEBREQUEST_URL="http://localhost:5000" + fi + export WX_TEST_WEBREQUEST_URL echo 'travis_fold:end:httpbin' }