-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.sh
108 lines (84 loc) · 1.12 KB
/
check.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
# Linters
function checkMypy() {
echo "-> Mypy"
mypy .
echo
}
function checkFlake8() {
echo "-> Flake8"
flake8
echo
}
function checkEsLint() {
echo "-> ES-Lint"
cd frontend || exit
npm run eslint
cd ..
echo
}
function checkLinters() {
echo
echo "*** --- Linters --- ***"
echo
checkMypy
checkFlake8
checkEsLint
}
# Unit/Integration tests
function testJest() {
echo "-> Jest"
cd frontend || exit
npm run test
cd ..
echo
}
function testPytest() {
echo "-> Pytest"
echo
pytest --ignore=frontend --cov-config=.coveragerc --cov=. -n auto
}
function testUnit() {
echo
echo "*** --- Unit/Integration Tests --- ***"
echo
testJest
testPytest
}
# All tests/checking
function all() {
checkLinters
testUnit
}
# Command line arg parser
case $1 in
mypy)
checkMypy
;;
flake8)
checkFlake8
;;
eslint)
checkEsLint
;;
linters)
checkLinters
;;
jest)
testJest
;;
pytest)
testPytest
;;
unit)
testUnit
;;
all)
all
;;
*)
echo
echo "Incorrect arg: $1."
echo
;;
esac