mirror of
https://github.com/senju1337/senju.git
synced 2025-12-23 23:39:27 +00:00
feat/OPS-31: added coverage feature
run coverage.sh to review the code coverage REQUIRED: poetry update
This commit is contained in:
parent
f60120245e
commit
ec9ed25b38
4 changed files with 114 additions and 7 deletions
28
coverage.sh
Normal file
28
coverage.sh
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
if [ -f .coverage ]; then
|
||||
echo "delete old .coverage-file..."
|
||||
rm .coverage
|
||||
fi
|
||||
echo "run coverage test..."
|
||||
poetry run coverage run -m pytest
|
||||
poetry run coverage annotate --directory=tests/coverage/report
|
||||
echo "generate coverage report..."
|
||||
poetry run coverage report
|
||||
echo "-----------------------------------------------------------------------"
|
||||
echo "available report file/s"
|
||||
rm .coverage
|
||||
cd tests/coverage/report || exit
|
||||
ls
|
||||
echo "-----------------------------------------------------------------------"
|
||||
echo "Go to tests/coverage/report to open a file for further information
|
||||
about covered and not covered code lines"
|
||||
cd ../../../
|
||||
if [ -d ".pytest_cache" ]; then
|
||||
read -r -p "do you want to remove .pytest_cache (y/n)?" decision
|
||||
if [[ "$decision" == "y" ]] || [[ "$decision" == "Y" ]]; then
|
||||
echo "deleting pytest cache..."
|
||||
rm -r .pytest_cache
|
||||
else
|
||||
echo "Die .coverage-Datei wurde nicht gelöscht."
|
||||
fi
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue