Skip to content

Commit

Permalink
feat: Run tests with pytest and measure coverage (#339)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Morega <[email protected]>
  • Loading branch information
mgax and mgax authored Nov 7, 2023
1 parent 4dcbceb commit bd1ee93
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ COPY docker/init-dev.sh /app/docker/

ADD https://raw.githubusercontent.com/mrako/wait-for/d9699cb9fe8a4622f05c4ee32adf2fd93239d005/wait-for /usr/local/bin/
USER root
RUN pip3 install pytest-django pytest-cov
RUN chmod +rx /usr/local/bin/wait-for
USER www

Expand All @@ -106,6 +107,7 @@ COPY docker/init-test.sh /app/docker/

ADD https://raw.githubusercontent.com/mrako/wait-for/d9699cb9fe8a4622f05c4ee32adf2fd93239d005/wait-for /usr/local/bin/
USER root
RUN pip3 install pytest-django pytest-cov
RUN chmod +rx /usr/local/bin/wait-for
USER www

Expand Down
2 changes: 1 addition & 1 deletion docker/init-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

python /app/manage.py migrate --no-input
python /app/manage.py createcachetable
/usr/local/bin/gunicorn --config /app/docker/gunicorn.py --reload ietf.wsgi
exec /usr/local/bin/gunicorn --config /app/docker/gunicorn.py --reload ietf.wsgi
2 changes: 1 addition & 1 deletion docker/init-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
python /app/manage.py migrate --no-input
python /app/manage.py createcachetable
python /app/manage.py collectstatic --no-input
python /app/manage.py test --no-input
pytest --cov
python /app/manage.py makemigrations --check --dry-run --no-input
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.pytest.ini_options]
addopts = "--reuse-db"
python_files = "ietf/*/test*.py"

0 comments on commit bd1ee93

Please sign in to comment.