Browse Source

Add code coverage

pull/205/head
Clemens Wolff 5 years ago
parent
commit
3a26bbe8a0
4 changed files with 19 additions and 1 deletions
  1. 15
      .coveragerc
  2. 1
      .dockerignore
  3. 1
      requirements.txt
  4. 3
      tools/ci.sh

15
.coveragerc

@ -0,0 +1,15 @@
[report]
omit =
app/app/wsgi.py
app/classifier/*
app/server/migrations/*
app/server/templatetags/*
app/server/tests/*
exclude_lines =
pragma: no cover
if __name__ == .__main__.
def __str__
raise NotImplementedError
fail_under = 90

1
.dockerignore

@ -8,5 +8,6 @@ app/server/webpack-stats.json
!data/ !data/
!tests/ !tests/
!tools/ !tools/
!.coveragerc
!.flake8 !.flake8
!requirements.txt !requirements.txt

1
requirements.txt

@ -1,4 +1,5 @@
applicationinsights==0.11.7 applicationinsights==0.11.7
coverage==4.5.3
dj-database-url==0.5.0 dj-database-url==0.5.0
Django==2.1.7 Django==2.1.7
django-filter==2.0.0 django-filter==2.0.0

3
tools/ci.sh

@ -5,6 +5,7 @@ set -o errexit
flake8 flake8
python app/manage.py migrate python app/manage.py migrate
python app/manage.py collectstatic python app/manage.py collectstatic
python app/manage.py test server.tests
coverage run --source=app app/manage.py test server.tests
coverage report
(cd app/server && npm run lint) (cd app/server && npm run lint)
Loading…
Cancel
Save