Skip to content

Commit cf75de7

Browse files
authored
fix(test): Randomly sample transactions for test runs (#22487)
1 parent 152a74d commit cf75de7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sentry/utils/pytest/sentry.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import absolute_import
22

3+
import pytest
4+
35
from sentry.utils.compat import mock
46
import os
57
from hashlib import md5
@@ -242,6 +244,7 @@ def pytest_collection_modifyitems(config, items):
242244
243245
- Filter tests that subclass SnubaTestCase as tests in `tests/acceptance` are not being marked as `snuba`
244246
- Select tests based on group and group strategy
247+
- Configure pytest-sentry
245248
246249
"""
247250

@@ -288,3 +291,6 @@ def pytest_collection_modifyitems(config, items):
288291
if len(discard) > 0:
289292
items[:] = keep
290293
config.hook.pytest_deselected(items=discard)
294+
295+
for item in items:
296+
item.add_marker(pytest.mark.sentry_client({"traces_sample_rate": 0.1}))

0 commit comments

Comments
 (0)