-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·42 lines (37 loc) · 693 Bytes
/
run_tests.sh
File metadata and controls
executable file
·42 lines (37 loc) · 693 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
# SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
#
# SPDX-License-Identifier: MPL-2.0
CONTAINER_BIN=podman
run_tests() {
pipenv run coverage run -m pytest -s -v --asyncio-mode=strict classquiz/tests
}
stop() {
$CONTAINER_BIN compose -f docker-compose.dev.yml down --volumes
}
init() {
if [ ! -d /tmp/storage ]; then
mkdir /tmp/storage
fi
$CONTAINER_BIN compose -f docker-compose.dev.yml up -d
sleep 2
pipenv run alembic upgrade head
}
case $1 in
+) init ;;
-) stop ;;
a)
$CONTAINER_BIN volume rm classquiz_db
init
run_tests
stop
;;
prepare)
stop
$CONTAINER_BIN volume rm classquiz_db
init
;;
*)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac