forked from DGNum/gestioCOF
Merge branch 'aureplop/add-codecoverage-to-ci' into 'master'
core -- Add code coverage to CI See merge request cof-geek/gestioCOF!314
This commit is contained in:
commit
56d979bb47
4 changed files with 23 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -10,6 +10,7 @@ venv/
|
||||||
media/
|
media/
|
||||||
*.log
|
*.log
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
|
.coverage
|
||||||
|
|
||||||
# PyCharm
|
# PyCharm
|
||||||
.idea
|
.idea
|
||||||
|
|
|
@ -36,9 +36,12 @@ before_script:
|
||||||
# Remove the old test database if it has not been done yet
|
# Remove the old test database if it has not been done yet
|
||||||
- psql --username=$POSTGRES_USER --host=$DBHOST -c "DROP DATABASE IF EXISTS test_$POSTGRES_DB"
|
- psql --username=$POSTGRES_USER --host=$DBHOST -c "DROP DATABASE IF EXISTS test_$POSTGRES_DB"
|
||||||
- pip install --upgrade --cache-dir vendor/pip -t vendor/python -r requirements.txt
|
- pip install --upgrade --cache-dir vendor/pip -t vendor/python -r requirements.txt
|
||||||
|
- pip install coverage
|
||||||
- python --version
|
- python --version
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- python manage.py test
|
- coverage run manage.py test
|
||||||
|
- coverage report
|
||||||
|
coverage: '/TOTAL.*\s(\d+\.\d+)\%$/'
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# GestioCOF
|
# GestioCOF
|
||||||
|
|
||||||
![build_status](https://git.eleves.ens.fr/cof-geek/gestioCOF/badges/master/build.svg)
|
[![pipeline status](https://git.eleves.ens.fr/cof-geek/gestioCOF/badges/master/pipeline.svg)](https://git.eleves.ens.fr/cof-geek/gestioCOF/commits/master)
|
||||||
|
[![coverage report](https://git.eleves.ens.fr/cof-geek/gestioCOF/badges/master/coverage.svg)](https://git.eleves.ens.fr/cof-geek/gestioCOF/commits/master)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
16
setup.cfg
Normal file
16
setup.cfg
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[coverage:run]
|
||||||
|
source =
|
||||||
|
bda
|
||||||
|
cof
|
||||||
|
gestioncof
|
||||||
|
kfet
|
||||||
|
shared
|
||||||
|
utils
|
||||||
|
omit =
|
||||||
|
*migrations*
|
||||||
|
*test*.py
|
||||||
|
branch = true
|
||||||
|
|
||||||
|
[coverage:report]
|
||||||
|
precision = 2
|
||||||
|
show_missing = true
|
Loading…
Reference in a new issue