-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·45 lines (38 loc) · 1.2 KB
/
run_tests.sh
File metadata and controls
executable file
·45 lines (38 loc) · 1.2 KB
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
#!/bin/sh
#
# Use this script to run unit tests.
set -e # Exit early if any commands fail
# Edit to change how tests run locally
# Use -u flag to run unit tests only
# Use -i flag to run integration tests only
# If no flags are provided, both unit and integration tests will run
while getopts "uih" option; do
case $option in
u)
python3 -m unittest discover -s tests/unit
;;
i)
python3 -m unittest discover -s tests/integration
;;
h)
echo "Usage: $0 [-u] [-i]"
echo " -u Run unit tests only"
echo " -i Run integration tests only"
exit 0
;;
*)
# code to execute when an unknown flag is provided
echo "Select test type: -u for unit tests, -i for integration tests"
exit 1
;;
esac
done
# If no flags are provided, run both unit and integration tests
if [ $OPTIND -eq 1 ]; then
echo "Running unit tests";
echo "----------------------------------------------------------------------";
python3 -m unittest discover -s tests/unit
echo "----------------------------------------------------------------------";
echo "Running integration tests";
python3 -m unittest discover -s tests/integration
fi