forked from hudson-and-thames/arbitragelab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoverage
executable file
·38 lines (33 loc) · 837 Bytes
/
coverage
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
#!/bin/bash
echo "----Running Code Coverage----"
# Remove multiprocessing coverage files in case a previous combine wasn't performed
rm -fR cover/
# Remove the main coverage file (.coverage)
. venv/bin/activate
coverage erase
# Discover and run all tests, check unit tests results
. venv/bin/activate
coverage run --concurrency=multiprocessing -m pytest tests/
res_test=$?
if [ $res_test -ne 0 ]
then
echo -e "Circle CI Build FAILURE: Unit tests failed"
exit 1
fi
# Check coverage results
. venv/bin/activate
coverage combine
res_combine=$?
if [ $res_combine -ne 0 ]
then
echo -e "Circle CI Build FAILURE: Coverage combine failed"
exit 1
fi
. venv/bin/activate
coverage report --fail-under=100
coverage_report=$?
if [ $coverage_report -ne 0 ]
then
echo -e "Circle CI Build FAILURE: Coverage percentage failed"
exit 1
fi