File: test-osx.sh

package info (click to toggle)
python-confluent-kafka 1.7.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,904 kB
  • sloc: python: 8,335; ansic: 6,065; sh: 1,203; makefile: 178
file content (59 lines) | stat: -rwxr-xr-x 1,473 bytes parent folder | download | duplicates (2)
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
#!/bin/bash -eu
#
#
# Tests wheels work on osx
#
# $tools/test-osx.sh [ wheelhouse ]

if [[ ! -f tools/$(basename $0) ]]; then
    echo "Must be called from confluent-kafka-python root directory"
    exit 1
fi

# clean up pytest_cache if it exists 
rm -f .pytest_cache

WHEELHOUSE=${1-wheelhouse} 

if [[ ! -d $WHEELHOUSE ]]; then
    echo "$WHEELHOUSE does not exist"
    exit 1
fi

# Make sure pip itself is up to date
pip install -U pip
hash -r # let go of previous 'pip'

# Install modules
# TODO: revisit to avoid hardcoding dependencies
pip install "futures;python_version=='2.7'" "enum34;python_version=='2.7'" requests avro

pip install confluent_kafka --no-cache-dir --no-index -f $WHEELHOUSE

# Pytest relies on a new version of six; later versions of pip fail to remove older versions gracefully
# https://github.com/pypa/pip/issues/5247
pip install pytest pytest-timeout --ignore-installed six

pushd ..

echo "Verifying OpenSSL and zlib are properly linked"
python -c '
import confluent_kafka

p = confluent_kafka.Producer({"ssl.cipher.suites":"DEFAULT",
                             "compression.codec":"gzip"})
'

echo "Verifying Interceptor installation"
python -c '
from confluent_kafka import Consumer

Consumer({"group.id": "test-osx", "plugin.library.paths": "monitoring-interceptor"})
'

echo "Running tests"
pytest -v --timeout 20 --ignore=tmp-build --import-mode append --ignore=confluent-kafka-python/tests/avro confluent-kafka-python/tests

popd