Skip to content

Commit

Permalink
fix: Fix pytest-cov performance
Browse files Browse the repository at this point in the history
Solution from nedbat/coveragepy#1665 (comment)
Thanks @trent-codecov for the suggestion.
  • Loading branch information
giovanni-guidini committed Apr 29, 2024
1 parent c2b2564 commit a0e1cad
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ lint:
make lint.run

test:
python -m pytest --cov=./ --junitxml=junit.xml
COVERAGE_CORE=sysmon python -m pytest --cov=./ --junitxml=junit.xml

test.unit:
python -m pytest --cov=./ -m "not integration" --cov-report=xml:unit.coverage.xml --junitxml=unit.junit.xml
COVERAGE_CORE=sysmon python -m pytest --cov=./ -m "not integration" --cov-report=xml:unit.coverage.xml --junitxml=unit.junit.xml

test.integration:
python -m pytest --cov=./ -m "integration" --cov-report=xml:integration.coverage.xml --junitxml=integration.junit.xml
COVERAGE_CORE=sysmon python -m pytest --cov=./ -m "integration" --cov-report=xml:integration.coverage.xml --junitxml=integration.junit.xml


update-requirements:
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ services:
- ./docker/test_codecov_config.yml:/config/codecov.yml
environment:
- SETUP__TIMESERIES__ENABLED=${TIMESERIES_ENABLED-true}
# Improves pytest-cov performance in python 3.12
# https://github.com/nedbat/coveragepy/issues/1665#issuecomment-1937075835
- COVERAGE_CORE=sysmon
env_file:
- .testenv
command:
Expand Down
27 changes: 18 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile
Expand All @@ -18,8 +18,8 @@ anyio==3.6.1
# openai
asgiref==3.7.2
# via django
attrs==20.3.0
# via pytest
async-timeout==4.0.3
# via redis
backoff==1.6.0
# via analytics-python
billiard==4.2.0
Expand Down Expand Up @@ -79,7 +79,7 @@ codecovopentelem @ https://github.com/codecov/opentelem-python/archive/refs/tags
# via -r requirements.in
colour==0.1.5
# via shared
coverage==5.5
coverage[toml]==7.5.0
# via
# -r requirements.in
# codecovopentelem
Expand Down Expand Up @@ -119,13 +119,15 @@ ecdsa==0.18.0
# via tlslite-ng
excel-base==1.0.4
# via django-excel-response2
exceptiongroup==1.2.1
# via pytest
factory-boy==3.2.0
# via -r requirements.in
faker==8.8.2
# via factory-boy
filelock==3.12.4
# via virtualenv
freezegun==1.2.2
freezegun==1.5.0
# via pytest-freezegun
google-api-core[grpc]==2.11.1
# via
Expand Down Expand Up @@ -249,7 +251,7 @@ packaging==20.9
# via pytest
platformdirs==3.11.0
# via virtualenv
pluggy==0.13.1
pluggy==1.5.0
# via pytest
pre-commit==3.4.0
# via -r requirements.in
Expand Down Expand Up @@ -292,7 +294,7 @@ pyparsing==2.4.7
# via
# httplib2
# packaging
pytest==7.2.0
pytest==8.1.1
# via
# -r requirements.in
# pytest-asyncio
Expand All @@ -305,7 +307,7 @@ pytest-asyncio==0.14.0
# via -r requirements.in
pytest-celery==0.0.0
# via -r requirements.in
pytest-cov==2.11.1
pytest-cov==5.0.0
# via -r requirements.in
pytest-django==4.7.0
# via -r requirements.in
Expand Down Expand Up @@ -359,7 +361,9 @@ requests==2.31.0
respx==0.20.2
# via -r requirements.in
rfc3986[idna2008]==1.4.0
# via httpx
# via
# httpx
# rfc3986
rsa==4.7.2
# via google-auth
s3transfer==0.10.1
Expand Down Expand Up @@ -414,12 +418,17 @@ timestring @ https://github.com/codecov/timestring/archive/d37ceacc5954dff3b5bd2
# via -r requirements.in
tlslite-ng==0.8.0b1
# via shared
tomli==2.0.1
# via
# coverage
# pytest
tqdm==4.66.1
# via openai
typing==3.7.4.3
# via shared
typing-extensions==4.6.3
# via
# asgiref
# openai
# opentelemetry-sdk
# pydantic
Expand Down

0 comments on commit a0e1cad

Please sign in to comment.