Skip to content

Commit bff8fdd

Browse files
authored
Fixed some tests (#4217)
- function transports have been removed. removing the related test - `profiles_sample_rate` is not experimental anymore - `continuous_profiling_mode` has been removed so only the top level `profiler_mode` exists. (so the if is not necessary anymore)
1 parent d32aaf0 commit bff8fdd

File tree

3 files changed

+12
-37
lines changed

3 files changed

+12
-37
lines changed

tests/integrations/wsgi/test_wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def test_app(environ, start_response):
437437

438438
sentry_init(
439439
traces_sample_rate=1.0,
440-
_experiments={"profiles_sample_rate": 1.0},
440+
profiles_sample_rate=1.0,
441441
)
442442
app = SentryWsgiMiddleware(test_app)
443443
envelopes = capture_envelopes()

tests/profiler/test_continuous_profiler.py

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,16 @@
2424
requires_gevent = pytest.mark.skipif(gevent is None, reason="gevent not enabled")
2525

2626

27-
def get_client_options(use_top_level_profiler_mode):
27+
def get_client_options():
2828
def client_options(
2929
mode=None, auto_start=None, profile_session_sample_rate=1.0, lifecycle="manual"
3030
):
31-
if use_top_level_profiler_mode:
32-
return {
33-
"profile_lifecycle": lifecycle,
34-
"profiler_mode": mode,
35-
"profile_session_sample_rate": profile_session_sample_rate,
36-
"_experiments": {
37-
"continuous_profiling_auto_start": auto_start,
38-
},
39-
}
4031
return {
4132
"profile_lifecycle": lifecycle,
33+
"profiler_mode": mode,
4234
"profile_session_sample_rate": profile_session_sample_rate,
4335
"_experiments": {
4436
"continuous_profiling_auto_start": auto_start,
45-
"continuous_profiling_mode": mode,
4637
},
4738
}
4839

@@ -60,8 +51,7 @@ def client_options(
6051
@pytest.mark.parametrize(
6152
"make_options",
6253
[
63-
pytest.param(get_client_options(True), id="non-experiment"),
64-
pytest.param(get_client_options(False), id="experiment"),
54+
pytest.param(get_client_options()),
6555
],
6656
)
6757
def test_continuous_profiler_invalid_mode(mode, make_options, teardown_profiling):
@@ -83,8 +73,7 @@ def test_continuous_profiler_invalid_mode(mode, make_options, teardown_profiling
8373
@pytest.mark.parametrize(
8474
"make_options",
8575
[
86-
pytest.param(get_client_options(True), id="non-experiment"),
87-
pytest.param(get_client_options(False), id="experiment"),
76+
pytest.param(get_client_options()),
8877
],
8978
)
9079
def test_continuous_profiler_valid_mode(mode, make_options, teardown_profiling):
@@ -106,8 +95,7 @@ def test_continuous_profiler_valid_mode(mode, make_options, teardown_profiling):
10695
@pytest.mark.parametrize(
10796
"make_options",
10897
[
109-
pytest.param(get_client_options(True), id="non-experiment"),
110-
pytest.param(get_client_options(False), id="experiment"),
98+
pytest.param(get_client_options()),
11199
],
112100
)
113101
def test_continuous_profiler_setup_twice(mode, make_options, teardown_profiling):
@@ -215,8 +203,7 @@ def assert_single_transaction_without_profile_chunks(envelopes):
215203
@pytest.mark.parametrize(
216204
"make_options",
217205
[
218-
pytest.param(get_client_options(True), id="non-experiment"),
219-
pytest.param(get_client_options(False), id="experiment"),
206+
pytest.param(get_client_options()),
220207
],
221208
)
222209
@mock.patch("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS", 0.01)
@@ -275,8 +262,7 @@ def test_continuous_profiler_auto_start_and_manual_stop(
275262
@pytest.mark.parametrize(
276263
"make_options",
277264
[
278-
pytest.param(get_client_options(True), id="non-experiment"),
279-
pytest.param(get_client_options(False), id="experiment"),
265+
pytest.param(get_client_options()),
280266
],
281267
)
282268
@mock.patch("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS", 0.01)
@@ -340,8 +326,7 @@ def test_continuous_profiler_manual_start_and_stop_sampled(
340326
@pytest.mark.parametrize(
341327
"make_options",
342328
[
343-
pytest.param(get_client_options(True), id="non-experiment"),
344-
pytest.param(get_client_options(False), id="experiment"),
329+
pytest.param(get_client_options()),
345330
],
346331
)
347332
def test_continuous_profiler_manual_start_and_stop_unsampled(
@@ -382,8 +367,7 @@ def test_continuous_profiler_manual_start_and_stop_unsampled(
382367
@pytest.mark.parametrize(
383368
"make_options",
384369
[
385-
pytest.param(get_client_options(True), id="non-experiment"),
386-
pytest.param(get_client_options(False), id="experiment"),
370+
pytest.param(get_client_options()),
387371
],
388372
)
389373
@mock.patch("sentry_sdk.profiler.continuous_profiler.DEFAULT_SAMPLING_FREQUENCY", 21)
@@ -444,8 +428,7 @@ def test_continuous_profiler_auto_start_and_stop_sampled(
444428
@pytest.mark.parametrize(
445429
"make_options",
446430
[
447-
pytest.param(get_client_options(True), id="non-experiment"),
448-
pytest.param(get_client_options(False), id="experiment"),
431+
pytest.param(get_client_options()),
449432
],
450433
)
451434
@mock.patch("sentry_sdk.profiler.continuous_profiler.PROFILE_BUFFER_SECONDS", 0.01)
@@ -493,8 +476,7 @@ def test_continuous_profiler_auto_start_and_stop_unsampled(
493476
@pytest.mark.parametrize(
494477
"make_options",
495478
[
496-
pytest.param(get_client_options(True), id="non-experiment"),
497-
pytest.param(get_client_options(False), id="experiment"),
479+
pytest.param(get_client_options()),
498480
],
499481
)
500482
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyle(

tests/test_client.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,6 @@ def test_socks_proxy(testcase, http2):
378378
)
379379

380380

381-
def test_simple_transport(sentry_init):
382-
events = []
383-
sentry_init(transport=events.append)
384-
capture_message("Hello World!")
385-
assert events[0]["message"] == "Hello World!"
386-
387-
388381
def test_ignore_errors(sentry_init, capture_events):
389382
sentry_init(ignore_errors=[ZeroDivisionError])
390383
events = capture_events()

0 commit comments

Comments
 (0)