Skip to content

Commit 71d83b3

Browse files
committed
Enable test profiling
1 parent dfa2a9c commit 71d83b3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/integration.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ jobs:
143143
invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
144144
145145
- uses: actions/upload-artifact@v4
146-
if: success() || failure()
147146
with:
148147
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-resp3
149-
path: '${{matrix.test-type}}*results.xml'
148+
path: '${{matrix.test-type}}*-results.xml'
149+
150+
- uses: actions/upload-artifact@v4
151+
with:
152+
name: pytest-profile-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}-resp3
153+
path: '${{matrix.test-type}}-profile.out'
150154

151155
- name: Upload codecov coverage
152156
uses: codecov/codecov-action@v4

tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def standalone_tests(c, uvloop=False, protocol=2):
5656
"""Run tests against a standalone redis instance"""
5757
if uvloop:
5858
run(
59-
f"pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --uvloop --junit-xml=standalone-uvloop-results.xml"
59+
f"python -m cProfile -o standalone-profile.out -m pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --uvloop --junit-xml=standalone-uvloop-results.xml"
6060
)
6161
else:
6262
run(
63-
f"pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-results.xml"
63+
f"python -m cProfile -o standalone-profile.out -m pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' --junit-xml=standalone-results.xml"
6464
)
6565

6666

@@ -70,11 +70,11 @@ def cluster_tests(c, uvloop=False, protocol=2):
7070
cluster_url = "redis://localhost:16379/0"
7171
if uvloop:
7272
run(
73-
f"pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-uvloop-results.xml --uvloop"
73+
f"python -m cProfile -o cluster-profile.out -m pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-uvloop-results.xml --uvloop"
7474
)
7575
else:
7676
run(
77-
f"pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_clusteclient.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-results.xml"
77+
f"python -m cProfile -o cluster-profile.out -m pytest --protocol={protocol} --cov=./ --cov-report=xml:coverage_clusteclient.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={cluster_url} --junit-xml=cluster-results.xml"
7878
)
7979

8080

0 commit comments

Comments
 (0)