Skip to content

Commit dd1512b

Browse files
rnpridgeonRyan P
authored andcommitted
Add runner script for running tests
1 parent b8fc4fd commit dd1512b

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

tests/run.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy