File size: 650 Bytes
7a18dc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Arguments for each test
BLACK_ARGS="--check"
RUFF_ARGS="check"
MYPY_ARGS=""
PYTEST_ARGS=""

# Use -f for 
while getopts 'f' OPTION; do
  case "$OPTION" in
    f)
      echo "Fix mode"
      BLACK_ARGS=""
      RUFF_ARGS+=" --fix"
      ;;
  esac
done
shift "$(($OPTIND -1))"

testheader () {
    echo -e '\n'
    echo "*"$emptyvar{1..20}
    echo $1
    echo "*"$emptyvar{1..20}
}

APPDIR=/app/src
TESTSDIR=/app/tests

testheader "black"
black $BLACK_ARGS $APPDIR $TESTSDIR

testheader "ruff"
ruff $RUFF_ARGS $APPDIR $TESTSDIR

testheader "mypy"
mypy $MYPY_ARGS $APPDIR $TESTSDIR

testheader "pytest"
pytest $PYTEST_ARGS $TESTSDIR/unit