Run httpbin locally for the tests in the CI builds

Run httpbin (either directly or inside a container) and set
WX_TEST_WEBREQUEST_URL to point to localhost.

Note that it is important _not_ to have a trailing slash in the root
URL, otherwise WebRequest::Auth::Digest test would fail.
This commit is contained in:
Vadim Zeitlin
2021-01-24 02:20:32 +01:00
parent d9d44c8585
commit 9307fa6f89
2 changed files with 23 additions and 0 deletions

View File

@@ -1,3 +1,12 @@
echo.
echo --- Running httpbin...
echo.
pip install httpbin
start /b python -m httpbin.core
set WX_TEST_WEBREQUEST_URL="http://127.0.0.1:5000"
curl http://127.0.0.1:5000/ip
echo.
echo --- Running tests.
echo.

View File

@@ -12,6 +12,16 @@ wxBUILD_ARGS="-j$wxPROC_COUNT"
# messages from WebKit tests that we're not interested in.
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"
export WX_TEST_WEBREQUEST_URL
echo 'travis_fold:end:httpbin'
}
case $wxTOOLSET in
cmake)
if [ -z $wxCMAKE_TESTS ]; then wxCMAKE_TESTS=CONSOLE_ONLY; fi
@@ -42,6 +52,8 @@ case $wxTOOLSET in
echo 'travis_fold:end:install'
if [ "$wxCMAKE_TESTS" != "OFF" ]; then
launch_httpbin
echo 'travis_fold:start:testing'
echo 'Testing...'
ctest -V -C Debug -E "test_drawing" --output-on-failure --interactive-debug-mode 0 .
@@ -124,6 +136,8 @@ case $wxTOOLSET in
exit 0
fi
launch_httpbin
echo 'travis_fold:start:testing'
echo 'Testing...'
pushd tests