how to exclude (directory or files) from coverage report

3.8k Views Asked by At

I am using django-jenkins and am trying to get jenkins to ignore a folder in my app in the coverage report.

I have found the option --coverage-exclude from https://github.com/kmmbvnr/django-jenkins/blob/master/django_jenkins/tasks/with_coverage.py, but cant seem to get it to work.

so far i have tried:

python [project]/manage.py jenkins [app] --coverage-exclude=COVERAGE_EXCLUDES_FOLDERS 

with

COVERAGE_EXCLUDES_FOLDERS = (
    '[app]/[dir to be excluded]/*'
)

and various combinations of path names

and also

python [project]/manage.py jenkins [app] --coverage-exclude='[path to dir]'

can anyone give me an idea of how i use this?

1

There are 1 best solutions below

1
Chris Herring On

I was having issues getting the migrations ignored during the coverage report, and found the following to work

COVERAGE_EXCLUDES_FOLDERS = ['people/migrations/*']

Rather than

COVERAGE_EXCLUDES_FOLDERS = ('people/migrations/*')