Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: speed up flagpole tests #74949

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Conversation

asottile-sentry
Copy link
Member

$ time pytest tests/flagpole/
/Users/asottile/workspace/sentry/.venv/lib/python3.11/site-packages/phabricator/__init__.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __version__ = __import__('pkg_resources') \
============================== test session starts ==============================
platform darwin -- Python 3.11.8, pytest-8.0.0, pluggy-1.4.0
django: version: 5.0.7
rootdir: /Users/asottile/workspace/sentry
configfile: pyproject.toml
plugins: fail-slow-0.3.0, rerunfailures-11.0, json-report-1.5.0, metadata-3.1.1, time-machine-2.13.0, xdist-3.0.2, pytest_sentry-0.3.0, anyio-3.7.1, django-4.8.0, cov-4.0.0
collected 45 items                                                              

tests/flagpole/test_conditions.py ..........................              [ 57%]
tests/flagpole/test_evaluation_context.py .........                       [ 77%]
tests/flagpole/test_feature.py ..........                                 [100%]

============================== 45 passed in 4.22s ===============================

real	0m7.365s
user	0m4.001s
sys	0m0.634s
$ git apply patch
$ time pytest tests/flagpole/
/Users/asottile/workspace/sentry/.venv/lib/python3.11/site-packages/phabricator/__init__.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __version__ = __import__('pkg_resources') \
============================== test session starts ==============================
platform darwin -- Python 3.11.8, pytest-8.0.0, pluggy-1.4.0
django: version: 5.0.7
rootdir: /Users/asottile/workspace/sentry
configfile: pyproject.toml
plugins: fail-slow-0.3.0, rerunfailures-11.0, json-report-1.5.0, metadata-3.1.1, time-machine-2.13.0, xdist-3.0.2, pytest_sentry-0.3.0, anyio-3.7.1, django-4.8.0, cov-4.0.0
collected 45 items                                                              

tests/flagpole/test_conditions.py ..........................              [ 57%]
tests/flagpole/test_evaluation_context.py .........                       [ 77%]
tests/flagpole/test_feature.py ..........                                 [100%]

============================== 45 passed in 0.55s ===============================

real	0m3.489s
user	0m2.584s
sys	0m0.549s

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.13%. Comparing base (ae8a805) to head (f0933c6).
Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #74949   +/-   ##
=======================================
  Coverage   78.13%   78.13%           
=======================================
  Files        6747     6747           
  Lines      301141   301141           
  Branches    51787    51787           
=======================================
+ Hits       235292   235294    +2     
+ Misses      59545    59541    -4     
- Partials     6304     6306    +2     

see 4 files with indirect coverage changes

@asottile-sentry asottile-sentry enabled auto-merge (squash) July 25, 2024 14:38
@asottile-sentry asottile-sentry merged commit ba2f759 into master Jul 25, 2024
50 checks passed
@asottile-sentry asottile-sentry deleted the asottile-speed-up-flagpole-tests branch July 25, 2024 17:40
Christinarlong pushed a commit that referenced this pull request Jul 26, 2024
```console
$ time pytest tests/flagpole/
/Users/asottile/workspace/sentry/.venv/lib/python3.11/site-packages/phabricator/__init__.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __version__ = __import__('pkg_resources') \
============================== test session starts ==============================
platform darwin -- Python 3.11.8, pytest-8.0.0, pluggy-1.4.0
django: version: 5.0.7
rootdir: /Users/asottile/workspace/sentry
configfile: pyproject.toml
plugins: fail-slow-0.3.0, rerunfailures-11.0, json-report-1.5.0, metadata-3.1.1, time-machine-2.13.0, xdist-3.0.2, pytest_sentry-0.3.0, anyio-3.7.1, django-4.8.0, cov-4.0.0
collected 45 items                                                              

tests/flagpole/test_conditions.py ..........................              [ 57%]
tests/flagpole/test_evaluation_context.py .........                       [ 77%]
tests/flagpole/test_feature.py ..........                                 [100%]

============================== 45 passed in 4.22s ===============================

real	0m7.365s
user	0m4.001s
sys	0m0.634s
$ git apply patch
$ time pytest tests/flagpole/
/Users/asottile/workspace/sentry/.venv/lib/python3.11/site-packages/phabricator/__init__.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __version__ = __import__('pkg_resources') \
============================== test session starts ==============================
platform darwin -- Python 3.11.8, pytest-8.0.0, pluggy-1.4.0
django: version: 5.0.7
rootdir: /Users/asottile/workspace/sentry
configfile: pyproject.toml
plugins: fail-slow-0.3.0, rerunfailures-11.0, json-report-1.5.0, metadata-3.1.1, time-machine-2.13.0, xdist-3.0.2, pytest_sentry-0.3.0, anyio-3.7.1, django-4.8.0, cov-4.0.0
collected 45 items                                                              

tests/flagpole/test_conditions.py ..........................              [ 57%]
tests/flagpole/test_evaluation_context.py .........                       [ 77%]
tests/flagpole/test_feature.py ..........                                 [100%]

============================== 45 passed in 0.55s ===============================

real	0m3.489s
user	0m2.584s
sys	0m0.549s
```

<!-- Describe your PR here. -->
@markstory
Copy link
Member

👏 👏

@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants