local-simu.sh 1.63 KB
Newer Older
Gregory Cugat's avatar
Gregory Cugat committed
1 2 3 4 5 6 7 8 9
#!/usr/bin/bash

if [ -d './dist' ]; then
	rm -f ./dist/*.*
fi

find . -name '*.pyc' -exec rm -f {} \;
find . -name '*.egg-info' -exec rm -rf {} \;
find . -name '__pycache__' -exec rm -rf {} \;
Gregory Cugat's avatar
Gregory Cugat committed
10
find . -name '.pytest_cache' -exec rm -rf {} \;
Gregory Cugat's avatar
Gregory Cugat committed
11 12 13 14 15 16 17 18 19 20 21

# Before Install
pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
pip install --upgrade pytest 
pip install pycodestyle
pip install codecov
pip install pytest-cov

# Library Install:
Gregory Cugat's avatar
Gregory Cugat committed
22 23 24 25 26
echo '*********************' | tee report.txt
echo '** LIBRARY INSTALL **' | tee -a report.txt
echo '*********************' | tee -a report.txt
python setup.py sdist | tee -a report.txt
pip install ./dist/* | tee -a report.txt
Gregory Cugat's avatar
Gregory Cugat committed
27 28

# Test Script:
Gregory Cugat's avatar
Gregory Cugat committed
29 30 31 32 33 34 35 36
echo '******************' | tee -a report.txt
echo '** TESTS SCRIPT **' | tee -a report.txt
echo '******************' | tee -a report.txt
echo '### Unitary tests ###' | tee -a report.txt
./tests/tests.py | tee -a report.txt
find . -name '*.pyc' -exec rm -f {} \;
echo '-------------------------------------------------------------------------' | tee -a report.txt
echo '### PYCODESTYLE ###' | tee -a report.txt
Gregory Cugat's avatar
Gregory Cugat committed
37
pycodestyle --first ./SOLIDserverRest/*.py | tee -a report.txt
Gregory Cugat's avatar
Gregory Cugat committed
38 39 40 41 42 43 44 45 46 47
echo '-------------------------------------------------------------------------' | tee -a report.txt
echo '### COVERAGE ###' | tee -a report.txt
coverage run ./SOLIDserverRest/*.py | tee -a report.txt
pytest --cov=./SOLIDserverRest tests/* | tee -a report.txt
echo '-------------------------------------------------------------------------' | tee -a report.txt

#CLEAN
find . -name '*.pyc' -exec rm -f {} \;
find . -name '*.egg-info' -exec rm -rf {} \;
find . -name '__pycache__' -exec rm -rf {} \;