18
18
19
19
wheeldir=$1
20
20
testdir=
21
-
21
+ all_fails=
22
22
23
23
if [[ -n $wheeldir ]]; then
24
24
if [[ ! -d $wheeldir ]]; then
@@ -28,23 +28,25 @@ if [[ -n $wheeldir ]]; then
28
28
python -m pip install virtualenv
29
29
fi
30
30
31
+ pyvers_tested=
31
32
32
33
# Run tests with both python2 and python3 (whatever versions the OS provides)
33
34
for py in 2.7 3.8 3.7 3.6 3.5 ; do
34
- echo " # Smoketest with Python$py "
35
+ echo " $0 : # Smoketest with Python$py "
35
36
36
37
if ! python$py -V ; then
37
38
echo " $0 : python$py not available: skipping"
38
39
continue
39
40
fi
40
41
42
+ pyvers_tested=" $pyvers_tested $py "
43
+
41
44
if [[ -n $wheeldir ]]; then
42
45
venvdir=$( mktemp -d /tmp/_venvXXXXXX)
43
46
44
47
function cleanup () {
45
48
set +e
46
49
deactivate
47
- echo $venvdir
48
50
rm -rf " $venvdir "
49
51
[[ -d $testdir ]] && rm -rf " $testdir "
50
52
set -e
@@ -67,7 +69,7 @@ for py in 2.7 3.8 3.7 3.6 3.5 ; do
67
69
# version we can pick any wheel file.
68
70
version=$( pkginfo -f version $( ls $wheeldir /confluent_kafka* .whl | head -1) | sed -e ' s/^version: //' )
69
71
if [[ -z $version ]]; then
70
- echo " Unable to parse version from wheel files in $wheeldir "
72
+ echo " $0 : Unable to parse version from wheel files in $wheeldir "
71
73
exit 1
72
74
fi
73
75
@@ -86,42 +88,53 @@ for py in 2.7 3.8 3.7 3.6 3.5 ; do
86
88
# Change to a neutral path where there is no confluent_kafka sub-directory
87
89
# that might interfere with module load.
88
90
pushd $testdir
89
- echo " Running unit tests"
91
+ echo " $0 : Running unit tests"
90
92
pytest
91
93
92
94
fails=" "
93
95
94
- echo " Verifying OpenSSL"
96
+ echo " $0 : Verifying OpenSSL"
95
97
python -c "
96
98
import confluent_kafka
97
99
confluent_kafka.Producer({'ssl.cipher.suites':'DEFAULT'})
98
100
" || fails=" $fails OpenSSL"
99
101
100
102
for compr in gzip lz4 snappy zstd; do
101
- echo " Verifying $compr "
103
+ echo " $0 : Verifying $compr "
102
104
python -c "
103
105
import confluent_kafka
104
106
confluent_kafka.Producer({'compression.codec':'$compr '})
105
107
" || fails=" $fails $compr "
106
108
done
107
109
108
- echo " Verifying Interceptor installation"
109
- echo " Note: Requires protobuf-c to be installed on the system."
110
+ echo " $0 : Verifying Interceptor installation"
111
+ echo " $0 : Note: Requires protobuf-c to be installed on the system."
110
112
python -c '
111
113
from confluent_kafka import Consumer
112
114
113
115
c = Consumer({"group.id": "test-linux", "plugin.library.paths": "monitoring-interceptor"})
114
- ' || echo " Warning: interceptor test failed, which we ignore"
116
+ ' || echo " $0 : Warning: interceptor test failed, which we ignore"
117
+
118
+
119
+ if [[ -n $fails ]]; then
120
+ echo " $0 : SMOKE TEST FAILS FOR python$py : $fails "
121
+ all_fails=" $all_fails \[py$py : $fails \]"
122
+ fi
115
123
116
124
popd # $testdir
117
125
done
118
126
119
- if [[ -z $fails ]]; then
120
- echo " ALL SMOKE TESTS PASSED"
127
+ if [[ -z $pyvers_tested ]]; then
128
+ echo " $0 : NO PYTHON VERSIONS TESTED"
129
+ exit 1
130
+ fi
131
+
132
+ if [[ -z $all_fails ]]; then
133
+ echo " $0 : ALL SMOKE TESTS PASSED (python versions:$pyvers_tested )"
121
134
exit 0
122
135
fi
123
136
124
- echo " SMOKE TEST FAILURES: $fails "
137
+ echo " $0 : SMOKE TEST FAILURES: $all_fails "
125
138
exit 1
126
139
127
140
0 commit comments