File: run.sh

package info (click to toggle)
python-confluent-kafka 1.7.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 1,900 kB
  • sloc: python: 8,335; ansic: 6,065; sh: 1,203; makefile: 178
file content (68 lines) | stat: -rwxr-xr-x 1,172 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

set -eu

TEST_SOURCE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
DOCKER_BIN=${TEST_SOURCE}/docker/bin

cleanup() {
        ${DOCKER_BIN}/cluster_down.sh
}

trap cleanup 0 2 3 6 15

source ${DOCKER_BIN}/../.env

if [[ ${1:-} == "help" ]]; then
    python ${TEST_SOURCE}/integration/integration_test.py --help
    exit 0
fi

start_cluster() {
    ${DOCKER_BIN}/cluster_up.sh
}

run_tox() {
    start_cluster
    echo "Executing tox $@"
    cd ${TEST_SOURCE}
    tox -r "$@"
}

run_native() {
    pip install -v .[avro]
    start_cluster

    for mode in "$@"; do
        modes="${modes:-} --${mode}"
    done

    echo "Executing test modes $@"
    python ${TEST_SOURCE}/integration/integration_test.py ${modes:-} ${TEST_SOURCE}/integration/testconf.json
}

run_unit() {
    py.test -v --timeout 20 --ignore=tmp-build
}

case ${1:-} in
    "unit")
        run_unit
        ;;
    "tox")
        shift
        run_tox $@
        ;;
    "all")
        shift
        run_unit $@
        run_native $@
        ;;
    "native")
        run_native $@
        ;;
    *)
        echo $"Usage: $0 {unit|tox|native|all}"
        exit 1
        ;;
esac