|
21 | 21 | EXPECT_PARAMS_IN_SELECT = False |
22 | 22 |
|
23 | 23 |
|
24 | | -def test_clickhouse_client_breadcrumbs(sentry_init, capture_events) -> None: |
| 24 | +@pytest.mark.parametrize("span_streaming", [True, False]) |
| 25 | +def test_clickhouse_client_breadcrumbs( |
| 26 | + sentry_init, capture_events, span_streaming |
| 27 | +) -> None: |
25 | 28 | sentry_init( |
26 | 29 | integrations=[ClickhouseDriverIntegration()], |
| 30 | + trace_lifecycle="stream" if span_streaming else "static", |
27 | 31 | _experiments={"record_sql_params": True}, |
28 | 32 | ) |
29 | 33 | events = capture_events() |
@@ -127,10 +131,14 @@ def test_clickhouse_client_breadcrumbs(sentry_init, capture_events) -> None: |
127 | 131 | assert actual_query_breadcrumbs == expected_breadcrumbs |
128 | 132 |
|
129 | 133 |
|
130 | | -def test_clickhouse_client_breadcrumbs_with_pii(sentry_init, capture_events) -> None: |
| 134 | +@pytest.mark.parametrize("span_streaming", [True, False]) |
| 135 | +def test_clickhouse_client_breadcrumbs_with_pii( |
| 136 | + sentry_init, capture_events, span_streaming |
| 137 | +) -> None: |
131 | 138 | sentry_init( |
132 | 139 | integrations=[ClickhouseDriverIntegration()], |
133 | 140 | send_default_pii=True, |
| 141 | + trace_lifecycle="stream" if span_streaming else "static", |
134 | 142 | _experiments={"record_sql_params": True}, |
135 | 143 | ) |
136 | 144 | events = capture_events() |
@@ -229,11 +237,13 @@ def test_clickhouse_client_breadcrumbs_with_pii(sentry_init, capture_events) -> |
229 | 237 | assert event["breadcrumbs"]["values"] == expected_breadcrumbs |
230 | 238 |
|
231 | 239 |
|
| 240 | +@pytest.mark.parametrize("span_streaming", [True, False]) |
232 | 241 | def test_clickhouse_client_breadcrumbs_with_data_collection( |
233 | | - sentry_init, capture_events |
| 242 | + sentry_init, capture_events, span_streaming |
234 | 243 | ) -> None: |
235 | 244 | sentry_init( |
236 | 245 | integrations=[ClickhouseDriverIntegration()], |
| 246 | + trace_lifecycle="stream" if span_streaming else "static", |
237 | 247 | _experiments={"data_collection": {"database_query_data": True}}, |
238 | 248 | ) |
239 | 249 | events = capture_events() |
@@ -332,11 +342,13 @@ def test_clickhouse_client_breadcrumbs_with_data_collection( |
332 | 342 | assert event["breadcrumbs"]["values"] == expected_breadcrumbs |
333 | 343 |
|
334 | 344 |
|
| 345 | +@pytest.mark.parametrize("span_streaming", [True, False]) |
335 | 346 | def test_clickhouse_client_breadcrumbs_with_data_collection_disabled( |
336 | | - sentry_init, capture_events |
| 347 | + sentry_init, capture_events, span_streaming |
337 | 348 | ) -> None: |
338 | 349 | sentry_init( |
339 | 350 | integrations=[ClickhouseDriverIntegration()], |
| 351 | + trace_lifecycle="stream" if span_streaming else "static", |
340 | 352 | _experiments={"data_collection": {"database_query_data": False}}, |
341 | 353 | ) |
342 | 354 | events = capture_events() |
@@ -431,12 +443,14 @@ def test_clickhouse_client_breadcrumbs_with_data_collection_disabled( |
431 | 443 | assert "db.result" not in crumb["data"] |
432 | 444 |
|
433 | 445 |
|
| 446 | +@pytest.mark.parametrize("span_streaming", [True, False]) |
434 | 447 | def test_clickhouse_client_breadcrumbs_data_collection_overrides_pii( |
435 | | - sentry_init, capture_events |
| 448 | + sentry_init, capture_events, span_streaming |
436 | 449 | ) -> None: |
437 | 450 | sentry_init( |
438 | 451 | integrations=[ClickhouseDriverIntegration()], |
439 | 452 | send_default_pii=True, |
| 453 | + trace_lifecycle="stream" if span_streaming else "static", |
440 | 454 | _experiments={"data_collection": {"database_query_data": False}}, |
441 | 455 | ) |
442 | 456 | events = capture_events() |
@@ -531,11 +545,13 @@ def test_clickhouse_client_breadcrumbs_data_collection_overrides_pii( |
531 | 545 | assert "db.result" not in crumb["data"] |
532 | 546 |
|
533 | 547 |
|
| 548 | +@pytest.mark.parametrize("span_streaming", [True, False]) |
534 | 549 | def test_clickhouse_client_breadcrumbs_with_data_collection_default( |
535 | | - sentry_init, capture_events |
| 550 | + sentry_init, capture_events, span_streaming |
536 | 551 | ) -> None: |
537 | 552 | sentry_init( |
538 | 553 | integrations=[ClickhouseDriverIntegration()], |
| 554 | + trace_lifecycle="stream" if span_streaming else "static", |
539 | 555 | _experiments={"data_collection": {}}, |
540 | 556 | ) |
541 | 557 | events = capture_events() |
|
0 commit comments