forked from astrolabsoftware/fink-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
code-checks.sh
executable file
·51 lines (40 loc) · 877 Bytes
/
code-checks.sh
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
51
#!/bin/bash
# Launch unit tests
# @author Fabrice Jammes
# set -euo pipefail
DIR=$(cd "$(dirname "$0")"; pwd -P)
. $CIUXCONFIG
unittests=false
mypy=false
usage() {
cat << EOD
Usage: $(basename "$0") [options]
Available options:
-h This message
-u Run unit tests
-m Run mypy
Perform code analysis, unit testing on fink-broker code.
EOD
}
# Get the options
while getopts hum c ; do
case $c in
h) usage ; exit 0 ;;
u) unittests=true ;;
m) mypy=true ;;
\?) usage ; exit 2 ;;
esac
done
shift "$((OPTIND-1))"
if [ $# -ne 0 ] ; then
usage
exit 2
fi
# Build image
$DIR/build.sh
if [ $unittests = true ]; then
docker run -- "$CIUX_IMAGE_URL" /home/fink/fink-broker/utest/bin/pytest.sh
fi
if [ $mypy = true ]; then
docker run -- "$CIUX_IMAGE_URL" mypy /home/fink/fink-broker/
fi