Skip to content

Commit

Permalink
Add pytest coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mormahr committed Feb 25, 2021
1 parent 9aacd47 commit 0265474
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,4 @@ dmypy.json
# End of https://www.toptal.com/developers/gitignore/api/python,intellij+all,macos,linux

test-data/*.pdf
coverage
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN pip install -r requirements.txt

COPY . .

RUN useradd -m pdf_service_user
RUN useradd -m pdf_service_user && chown pdf_service_user .
USER pdf_service_user

ARG GITHUB_SHA
Expand Down
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ services:
- "./tests:/usr/src/app/tests"
- "./test-data:/usr/src/app/test-data"
- "./src:/usr/src/app/src"
- "./coverage:/usr/src/app/coverage"
- "./.pytest_cache:/usr/src/app/.pytest_cache"
command: python -m pytest
command: |
python -m pytest
--cov=pdf_service
--cov-report term
--cov-report html:coverage/cov_html
--cov-report xml:coverage/cov.xml
--cov-report annotate:coverage/cov_annotate
test-watch:
build: .
volumes:
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cffi==1.14.5
chardet==4.0.0
click==7.1.2
colorama==0.4.4
coverage==5.4
cryptography==3.4.6
cssselect2==0.4.1
defusedxml==0.6.0
Expand All @@ -29,6 +30,7 @@ pycparser==2.20
pyparsing==2.4.7
Pyphen==0.10.0
pytest==6.2.2
pytest-cov==2.11.1
pytest-watch==4.2.0
sentry-sdk==0.20.3
six==1.15.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'pdf2image == 1.14.0',
'diffimg == 0.3.0',
'pytest-watch',
'pytest-cov',
'fire',
]
}
Expand Down

0 comments on commit 0265474

Please sign in to comment.