File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash -eu
2
+
3
+ TEST_SOURCE=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null && pwd ) "
4
+ DOCKER_BIN=${TEST_SOURCE} /docker/bin
5
+
6
+ cleanup () {
7
+ ${DOCKER_BIN} /cluster_down.sh
8
+ }
9
+
10
+ trap cleanup 0 2 3 6 15
11
+
12
+ source ${DOCKER_BIN} /../.env
13
+
14
+ if [[ ${1:- } == " help" ]]; then
15
+ python ${TEST_SOURCE} /integration/integration_test.py --help
16
+ exit 0
17
+ fi
18
+
19
+ start_cluster () {
20
+ ${DOCKER_BIN} /cluster_up.sh
21
+ }
22
+
23
+ run_tox () {
24
+ start_cluster
25
+ echo " Executing tox $@ "
26
+ cd ${TEST_SOURCE}
27
+ tox -r " $@ "
28
+ }
29
+
30
+ run_native () {
31
+ pip install -v .[avro]
32
+ start_cluster
33
+
34
+ for mode in " $@ " ; do
35
+ modes=" ${modes:- } --${mode} "
36
+ done
37
+
38
+ echo " Executing test modes $@ "
39
+ python ${TEST_SOURCE} /integration/integration_test.py ${modes:- } ${TEST_SOURCE} /integration/testconf.json
40
+ }
41
+
42
+ run_unit () {
43
+ py.test -v --timeout 20 --ignore=tmp-build
44
+ }
45
+
46
+ case ${1:- } in
47
+ " unit" )
48
+ run_unit
49
+ ;;
50
+ " tox" )
51
+ shift
52
+ run_tox $@
53
+ ;;
54
+ " all" )
55
+ shift
56
+ run_unit $@
57
+ run_native $@
58
+ ;;
59
+ * )
60
+ run_native $@
61
+ ;;
62
+ esac
You can’t perform that action at this time.
0 commit comments