-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·50 lines (45 loc) · 950 Bytes
/
run_tests.sh
File metadata and controls
executable file
·50 lines (45 loc) · 950 Bytes
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
#!/usr/bin/env bash
set -x
POSITIONAL_ARGS=()
TESTS=("tests")
while [[ $# -gt 0 ]]; do
case $1 in
--aws)
TESTS=("tests_aws")
shift # past argument
shift # past value
;;
--default)
TESTS=("tests")
shift # past argument
shift # past value
;;
--all)
TESTS=("tests tests_aws")
shift # past argument
shift # past value
;;
--cov)
COVERAGE=True
shift # past argument
shift # past value
;;
-*|--*)
echo "Unknown option 1" # save positional arg
shift # past argument
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [ -z ${COVERAGE} ]; then
pytest -vv "${TESTS[@]}"
else
coverage run \
--source=instana \
--module pytest \
--verbose \
--junitxml=test-results \
"${TESTS[@]}" # pytest options (not coverage options anymore)
coverage report -m
coverage html
fi