File: httpbin.sh

package info (click to toggle)
wxwidgets3.2 3.2.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 178,916 kB
  • sloc: cpp: 989,283; ansic: 102,143; makefile: 51,586; sh: 11,566; python: 5,590; perl: 1,563; php: 326; xml: 200; javascript: 181
file content (28 lines) | stat: -rw-r--r-- 923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 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
}