From 79855af2b62223c53049fead62706255b45ce48c Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 14:14:27 +0100 Subject: [PATCH 01/70] Remove outdated pins --- test-requirements.txt | 2 +- tox.ini | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index c9324e753b..9c847e2ca3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ mock ; python_version<'3.3' pytest pytest-cov==2.8.1 pytest-forked<=1.4.0 -pytest-localserver==0.5.1 # TODO(py3): 0.6.0 drops 2.7 support: https://github.com/pytest-dev/pytest-localserver/releases/tag/v0.6.0 +pytest-localserver pytest-watch==4.2.0 tox==3.7.0 jsonschema==3.2.0 diff --git a/tox.ini b/tox.ini index 0be7733f67..cd82e2da47 100644 --- a/tox.ini +++ b/tox.ini @@ -638,11 +638,8 @@ basepython = commands = {py3.7,py3.8}-boto3: pip install urllib3<2.0.0 - ; https://github.com/pytest-dev/pytest/issues/5532 - {py3.6,py3.7,py3.8,py3.9}-flask-v{0.11,0.12}: pip install pytest<5 - {py3.6,py3.7,py3.8,py3.9}-flask-v{0.11}: pip install Werkzeug<2 ; https://github.com/pallets/flask/issues/4455 - {py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{0.11,0.12,1.0,1.1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1" + {py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1" ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to From fd3ed36b8c44d883e8ed080651f253b6a3c244a7 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 14:23:32 +0100 Subject: [PATCH 02/70] Remove more pins --- test-requirements.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 9c847e2ca3..8e6b29f5d7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,4 @@ pip # always use newest pip -mock ; python_version<'3.3' pytest pytest-cov==2.8.1 pytest-forked<=1.4.0 @@ -7,8 +6,8 @@ pytest-localserver pytest-watch==4.2.0 tox==3.7.0 jsonschema==3.2.0 -pyrsistent==0.16.0 # TODO(py3): 0.17.0 requires python3, see https://github.com/tobgu/pyrsistent/issues/205 -executing<2.0.0 # TODO(py3): 2.0.0 requires python3 +pyrsistent +executing asttokens responses pysocks From 4a0b04e37416cf816f040137148b07e677fc0fbc Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 14:29:22 +0100 Subject: [PATCH 03/70] more pins --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 8e6b29f5d7..293251adb6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ pip # always use newest pip pytest pytest-cov==2.8.1 -pytest-forked<=1.4.0 +pytest-forked pytest-localserver pytest-watch==4.2.0 tox==3.7.0 From 9c4c48acd6a579f19182fbcf5efa9c85a272674c Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 14:40:27 +0100 Subject: [PATCH 04/70] remove all the pins! --- test-requirements.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 293251adb6..8d6791c464 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,11 +1,11 @@ -pip # always use newest pip +pip pytest -pytest-cov==2.8.1 +pytest-cov pytest-forked pytest-localserver -pytest-watch==4.2.0 -tox==3.7.0 -jsonschema==3.2.0 +pytest-watch +tox +jsonschema pyrsistent executing asttokens From 0f722231896838ae77ea6efa2dd5834215f5861d Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 14:42:36 +0100 Subject: [PATCH 05/70] ok not all at once --- test-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 8d6791c464..f6949a2729 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,9 +3,9 @@ pytest pytest-cov pytest-forked pytest-localserver -pytest-watch +pytest-watch==4.2.0 tox -jsonschema +jsonschema==3.2.0 pyrsistent executing asttokens From 5427ea3743925081ce34e944cad49567cceae735 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 14:47:38 +0100 Subject: [PATCH 06/70] lets start with tox --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index f6949a2729..a26f37ce60 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ pip pytest -pytest-cov +pytest-cov==2.8.1 pytest-forked pytest-localserver pytest-watch==4.2.0 From 336f2608bf114f862dc87a9c2fd64e50dd16e4b7 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 30 Jan 2024 15:06:41 +0100 Subject: [PATCH 07/70] ok not touching tox yet --- test-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index a26f37ce60..2cd8776176 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,8 +3,8 @@ pytest pytest-cov==2.8.1 pytest-forked pytest-localserver -pytest-watch==4.2.0 -tox +pytest-watch +tox==3.7.0 jsonschema==3.2.0 pyrsistent executing From 9d9898fb81956f50fa67968fa949a03a65d09f1e Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 14:54:19 +0100 Subject: [PATCH 08/70] drop jsonschema pin --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 2cd8776176..deaf6b3c63 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ pytest-forked pytest-localserver pytest-watch tox==3.7.0 -jsonschema==3.2.0 +jsonschema pyrsistent executing asttokens From 050f97b78de1245a7faff206484effab23f82f03 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 15:01:37 +0100 Subject: [PATCH 09/70] bisecting.. --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index deaf6b3c63..97f1e5323c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ pytest-forked pytest-localserver pytest-watch tox==3.7.0 -jsonschema +jsonschema==4.0.1 pyrsistent executing asttokens From 6e9c8bf9bf6bea8b97fe2b8113f52f5a10388c09 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 16:30:19 +0100 Subject: [PATCH 10/70] fix new beam --- test-requirements.txt | 2 +- tests/integrations/beam/test_beam.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 97f1e5323c..deaf6b3c63 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ pytest-forked pytest-localserver pytest-watch tox==3.7.0 -jsonschema==4.0.1 +jsonschema pyrsistent executing asttokens diff --git a/tests/integrations/beam/test_beam.py b/tests/integrations/beam/test_beam.py index 7926521ca6..d14c8a23e8 100644 --- a/tests/integrations/beam/test_beam.py +++ b/tests/integrations/beam/test_beam.py @@ -182,7 +182,11 @@ def inner(fn): signature = pardo._signature output_processor = _OutputHandler() return DoFnInvoker.create_invoker( - signature, output_processor, DoFnContext("test") + signature, + output_processor, + DoFnContext("test"), + input_args=[], + input_kwargs={}, ) return inner From 7d64ad127c3a256a2ea7591c03b0db79db795567 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 16:32:51 +0100 Subject: [PATCH 11/70] remove pin on pytest-cov --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index deaf6b3c63..c421f85c4b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ pip pytest -pytest-cov==2.8.1 +pytest-cov pytest-forked pytest-localserver pytest-watch From b99c87680b4747af527ecefca4d8a2ab50492211 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 16:43:15 +0100 Subject: [PATCH 12/70] tox step by step --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index c421f85c4b..29125842cb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox==3.7.0 +tox<4 jsonschema pyrsistent executing From 1c2700cb300e8d036d26fa3515cb68c69deda717 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 16:51:25 +0100 Subject: [PATCH 13/70] pytest deprecation --- tests/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index cac15f9333..8a5dfaec96 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,7 +1,6 @@ +import warnings import sys -import pytest - # This is used in _capture_internal_warnings. We need to run this at import # time because that's where many deprecation warnings might get thrown. # @@ -9,5 +8,5 @@ # gets loaded too late. assert "sentry_sdk" not in sys.modules -_warning_recorder_mgr = pytest.warns(None) +_warning_recorder_mgr = warnings.catch_warnings(record=True) _warning_recorder = _warning_recorder_mgr.__enter__() From 6659e97cca06a7f930774abcb7de6897f02898b6 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 17:07:49 +0100 Subject: [PATCH 14/70] no distutils on 3.12 --- tests/integrations/rq/test_rq.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integrations/rq/test_rq.py b/tests/integrations/rq/test_rq.py index 3f2218c945..7725b80f78 100644 --- a/tests/integrations/rq/test_rq.py +++ b/tests/integrations/rq/test_rq.py @@ -16,8 +16,10 @@ def _patch_rq_get_server_version(monkeypatch): https://github.com/jamesls/fakeredis/issues/273 """ - - from distutils.version import StrictVersion + try: + from distutils.version import StrictVersion + except ImportError: + return if parse_version(rq.VERSION) <= (1, 5, 1): for k in ( From 0953fa7b2456ce398056fb28f5e7eea7e530f2ba Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 17:45:48 +0100 Subject: [PATCH 15/70] add setuptools, fix pytest for redis --- test-requirements.txt | 1 + tox.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/test-requirements.txt b/test-requirements.txt index 29125842cb..9f20d2db79 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,3 +12,4 @@ asttokens responses pysocks ipdb +setuptools diff --git a/tox.ini b/tox.ini index cd82e2da47..2f5aabe7b4 100644 --- a/tox.ini +++ b/tox.ini @@ -464,6 +464,7 @@ deps = # Redis redis: fakeredis!=1.7.4 + redis: pytest<8.0.0 {py3.7,py3.8,py3.9,py3.10,py3.11}-redis: pytest-asyncio<=0.21.1 redis-v3: redis~=3.0 redis-v4: redis~=4.0 From 66d46d51fb64e28a537b8e71f2bfc7b20788fe00 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 17:53:58 +0100 Subject: [PATCH 16/70] again --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 9f20d2db79..174d45f3c2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox<4 +tox jsonschema pyrsistent executing From f3fed1294a1ca8063641e6bd54644264ef268c12 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Tue, 6 Feb 2024 17:57:44 +0100 Subject: [PATCH 17/70] ? --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 8a5dfaec96..2e4df719d5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ -import warnings import sys +import warnings # This is used in _capture_internal_warnings. We need to run this at import # time because that's where many deprecation warnings might get thrown. From 56cc583b5c3374c3343a0579ee195a1b2725c41f Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 14:03:14 +0200 Subject: [PATCH 18/70] compat import not needed anymore --- tests/integrations/django/myapp/settings.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/integrations/django/myapp/settings.py b/tests/integrations/django/myapp/settings.py index ac06d9204e..721cef0984 100644 --- a/tests/integrations/django/myapp/settings.py +++ b/tests/integrations/django/myapp/settings.py @@ -17,16 +17,9 @@ sentry_sdk.init(integrations=[DjangoIntegration()]) - import os -try: - # Django >= 1.10 - from django.utils.deprecation import MiddlewareMixin -except ImportError: - # Not required for Django <= 1.9, see: - # https://docs.djangoproject.com/en/1.10/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware - MiddlewareMixin = object +from django.utils.deprecation import MiddlewareMixin # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From 214b210fa380b3b276179a6e097fb08a6e7d8b7e Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 16:47:07 +0200 Subject: [PATCH 19/70] is it tox? --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 174d45f3c2..9fa5b9a4b5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox +tox==3.7.0 jsonschema pyrsistent executing From 87f6118db7ac0e8d984b104d31c430c56ab72bc3 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 16:50:15 +0200 Subject: [PATCH 20/70] is it tox<4? --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 9fa5b9a4b5..9f20d2db79 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox==3.7.0 +tox<4 jsonschema pyrsistent executing From b7134508d92a59b83ee25a039f4edad201006c46 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 16:55:35 +0200 Subject: [PATCH 21/70] is it tox 4? --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 9f20d2db79..494ddcb129 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox<4 +tox==4.0.0 jsonschema pyrsistent executing From e26b1c272a3eb01e980d56c45ceb8a6970ef0b51 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 17:01:28 +0200 Subject: [PATCH 22/70] tox 4.0.19? --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 494ddcb129..3679feba9b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox==4.0.0 +tox==4.0.19 jsonschema pyrsistent executing From 0d0b5dcf3f13d2b60eaf7e18cf6cc001cccb6cf5 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 17:15:35 +0200 Subject: [PATCH 23/70] sad --- test-requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 3679feba9b..74b3b6e761 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,8 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox==4.0.19 +tox; python_version < '3.12' +tox<4; python_version >= '3.12' jsonschema pyrsistent executing From 6ac9dc05821e72f28e4571a731f5ce595ef1d875 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Wed, 3 Apr 2024 17:20:34 +0200 Subject: [PATCH 24/70] add comment --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 74b3b6e761..ae6a61d2b9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ pytest-forked pytest-localserver pytest-watch tox; python_version < '3.12' -tox<4; python_version >= '3.12' +tox<4; python_version >= '3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent executing From a1eaf1d666253add58f316c24acc1aa762a9b57e Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 10:11:03 +0200 Subject: [PATCH 25/70] formatting --- test-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index ae6a61d2b9..ea30e06e0c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,8 +4,8 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox; python_version < '3.12' -tox<4; python_version >= '3.12' # TODO: >=4 makes async django tests hang in CI +tox; python_version<'3.12' +tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent executing From f0989b80da1ecb247f580bb8cbaf93be6ddcb211 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 10:15:17 +0200 Subject: [PATCH 26/70] trying somethin --- tests/integrations/django/asgi/test_asgi.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integrations/django/asgi/test_asgi.py b/tests/integrations/django/asgi/test_asgi.py index 87c85109ef..d143dd7136 100644 --- a/tests/integrations/django/asgi/test_asgi.py +++ b/tests/integrations/django/asgi/test_asgi.py @@ -25,7 +25,6 @@ @pytest.mark.parametrize("application", APPS) @pytest.mark.asyncio -@pytest.mark.forked async def test_basic(sentry_init, capture_events, application): sentry_init(integrations=[DjangoIntegration()], send_default_pii=True) From b6b8627559ffea135b600a1dddad3facf9b89c24 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 10:15:36 +0200 Subject: [PATCH 27/70] wip --- test-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index ea30e06e0c..c1175b05c8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,8 +4,8 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox; python_version<'3.12' -tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI +tox#; python_version<'3.12' +#tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent executing From 07549e9cd644731fe5533bbd8419717f12bc7e79 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 10:16:43 +0200 Subject: [PATCH 28/70] wip --- test-requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index c1175b05c8..0798db0571 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,8 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox#; python_version<'3.12' +tox +#tox; python_version<'3.12' #tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent From dc8dc524b313ac77064b3854b7ec40bbcc16104b Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 12:16:24 +0200 Subject: [PATCH 29/70] change tox pin in ci yamls --- .github/workflows/test-integrations-aws-lambda.yml | 2 +- .github/workflows/test-integrations-cloud-computing.yml | 4 ++-- .github/workflows/test-integrations-common.yml | 2 +- .github/workflows/test-integrations-data-processing.yml | 4 ++-- .github/workflows/test-integrations-databases.yml | 4 ++-- .github/workflows/test-integrations-graphql.yml | 4 ++-- .github/workflows/test-integrations-miscellaneous.yml | 4 ++-- .github/workflows/test-integrations-networking.yml | 4 ++-- .github/workflows/test-integrations-web-frameworks-1.yml | 4 ++-- .github/workflows/test-integrations-web-frameworks-2.yml | 4 ++-- scripts/split-tox-gh-actions/templates/test_group.jinja | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws-lambda.yml index 7b59c7632a..b8a453b50f 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws-lambda.yml @@ -73,7 +73,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud-computing.yml index d56d3969ab..62bdbcf6f5 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud-computing.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +86,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index 4945bfec5f..c15446533b 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-data-processing.yml index ed2e261d07..51cd986736 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-data-processing.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase @@ -94,7 +94,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index 7bfbd22725..3e7f5bfb4f 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -58,7 +58,7 @@ jobs: - uses: getsentry/action-clickhouse-in-ci@v1 - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage @@ -136,7 +136,7 @@ jobs: - uses: getsentry/action-clickhouse-in-ci@v1 - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index 5595437fa7..ffad9d78df 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +86,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-miscellaneous.yml index 537730220e..c8bae41e26 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-miscellaneous.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +86,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-networking.yml index 9f5c70ddda..51837cc73b 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-networking.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +86,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 9a0fd351cd..4a8f9140bc 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -57,7 +57,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage @@ -126,7 +126,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-frameworks-2.yml index 7b71959fb2..4222c8b501 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-frameworks-2.yml @@ -38,7 +38,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase @@ -106,7 +106,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index c40d5eaa5f..58692d99d0 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -55,7 +55,7 @@ - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox {% if needs_postgres %} psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true From 62a2366279332eba0efa8d78916791731dbd13e4 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 12:21:11 +0200 Subject: [PATCH 30/70] return the fork --- tests/integrations/django/asgi/test_asgi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integrations/django/asgi/test_asgi.py b/tests/integrations/django/asgi/test_asgi.py index d143dd7136..87c85109ef 100644 --- a/tests/integrations/django/asgi/test_asgi.py +++ b/tests/integrations/django/asgi/test_asgi.py @@ -25,6 +25,7 @@ @pytest.mark.parametrize("application", APPS) @pytest.mark.asyncio +@pytest.mark.forked async def test_basic(sentry_init, capture_events, application): sentry_init(integrations=[DjangoIntegration()], send_default_pii=True) From affe24ba449fbe1424b50333b06332dcab48c09c Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 12:23:27 +0200 Subject: [PATCH 31/70] remove dependabot ignores --- .github/dependabot.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d375588780..2b91d51cc0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,27 +9,9 @@ updates: - dependency-type: direct - dependency-type: indirect ignore: - - dependency-name: pytest - versions: - - "> 3.7.3" - - dependency-name: flake8 # Later versions dropped Python 2 support - versions: - - "> 5.0.4" - - dependency-name: jsonschema # Later versions dropped Python 2 support - versions: - - "> 3.2.0" - - dependency-name: pytest-cov - versions: - - "> 2.8.1" - - dependency-name: pytest-forked - versions: - - "> 1.1.3" - dependency-name: sphinx versions: - ">= 2.4.a, < 2.5" - - dependency-name: tox - versions: - - "> 3.7.0" - dependency-name: werkzeug versions: - "> 0.15.5, < 1" From 0f60c5b17086173a4d83b14e78afeee7d981670e Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 14:25:37 +0200 Subject: [PATCH 32/70] trying somethin --- scripts/runtox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtox.sh b/scripts/runtox.sh index dbbb4f2e10..50da44dd53 100755 --- a/scripts/runtox.sh +++ b/scripts/runtox.sh @@ -40,4 +40,4 @@ if [ -z "${ENV}" ]; then exit 0 fi -exec $TOXPATH -vv -e "$ENV" -- "${@:2}" +exec $TOXPATH -e "$ENV" -- "${@:2}" From d49324eb1beee5623a77048ddf401b8bb1b2fc6d Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 14:44:19 +0200 Subject: [PATCH 33/70] wip --- tests/integrations/django/test_basic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index 083add6b6e..2ebd57fa0a 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -275,7 +275,7 @@ def test_trace_from_headers_if_performance_disabled( @pytest.mark.forked -@pytest.mark.django_db +@pytest_mark_django_db_decorator() def test_user_captured(sentry_init, client, capture_events): sentry_init(integrations=[DjangoIntegration()], send_default_pii=True) events = capture_events() @@ -297,7 +297,7 @@ def test_user_captured(sentry_init, client, capture_events): @pytest.mark.forked -@pytest.mark.django_db +@pytest_mark_django_db_decorator() def test_queryset_repr(sentry_init, capture_events): sentry_init(integrations=[DjangoIntegration()]) events = capture_events() @@ -358,7 +358,7 @@ def test_management_command_raises(): @pytest.mark.forked -@pytest.mark.django_db +@pytest_mark_django_db_decorator() @pytest.mark.parametrize("with_integration", [True, False]) def test_sql_queries(sentry_init, capture_events, with_integration): sentry_init( From 8d8e12a67ce1c4dd28ea60467849536bcd1b3ae5 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Thu, 4 Apr 2024 17:07:42 +0200 Subject: [PATCH 34/70] try bumping protobuf types --- linter-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linter-requirements.txt b/linter-requirements.txt index c390f5fe70..289df0cd7f 100644 --- a/linter-requirements.txt +++ b/linter-requirements.txt @@ -2,7 +2,7 @@ mypy black flake8==5.0.4 # flake8 depends on pyflakes>=3.0.0 and this dropped support for Python 2 "# type:" comments types-certifi -types-protobuf==4.24.0.20240311 # newer raises an error on mypy sentry_sdk +types-protobuf types-redis types-setuptools pymongo # There is no separate types module. From 59401e5af4ae0e91b35a4220adadcc54de4790de Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 10:50:58 +0200 Subject: [PATCH 35/70] make tox verbose again --- scripts/runtox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtox.sh b/scripts/runtox.sh index 50da44dd53..dbbb4f2e10 100755 --- a/scripts/runtox.sh +++ b/scripts/runtox.sh @@ -40,4 +40,4 @@ if [ -z "${ENV}" ]; then exit 0 fi -exec $TOXPATH -e "$ENV" -- "${@:2}" +exec $TOXPATH -vv -e "$ENV" -- "${@:2}" From e81c1e99c82b43710dd4c3f34d4342f37b566bd3 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 11:13:52 +0200 Subject: [PATCH 36/70] trying something --- tests/integrations/sqlalchemy/test_sqlalchemy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index e11b59c630..3a4135ccb8 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -234,7 +234,7 @@ def processor(event, hint): event["message"] = long_str return event - engine = create_engine("sqlite:///:memory:") + engine = create_engine("sqlite:///:memory:?check_same_thread=false") with start_transaction(name="test"): with engine.connect() as con: for _ in range(1500): From 5d3f511df0b4d91ee8b82d597709a11124ef7cdd Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 11:20:46 +0200 Subject: [PATCH 37/70] another attempt --- tests/integrations/sqlalchemy/test_sqlalchemy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index 3a4135ccb8..22ea697152 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -234,7 +234,9 @@ def processor(event, hint): event["message"] = long_str return event - engine = create_engine("sqlite:///:memory:?check_same_thread=false") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) with start_transaction(name="test"): with engine.connect() as con: for _ in range(1500): From 0f146addb6e3e18635d11bce644a14cd6d8daace Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 11:25:34 +0200 Subject: [PATCH 38/70] ? --- tests/integrations/sqlalchemy/test_sqlalchemy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index 22ea697152..a3fe332575 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -238,7 +238,7 @@ def processor(event, hint): "sqlite:///:memory:", connect_args={"check_same_thread": False} ) with start_transaction(name="test"): - with engine.connect() as con: + with engine.connect(check_same_thread=False) as con: for _ in range(1500): con.execute( text(" UNION ".join("SELECT {}".format(i) for i in range(100))) From db5e3f11300913e73ce60c8b6916855006d4e1c8 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 11:30:50 +0200 Subject: [PATCH 39/70] revert --- tests/integrations/sqlalchemy/test_sqlalchemy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index a3fe332575..22ea697152 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -238,7 +238,7 @@ def processor(event, hint): "sqlite:///:memory:", connect_args={"check_same_thread": False} ) with start_transaction(name="test"): - with engine.connect(check_same_thread=False) as con: + with engine.connect() as con: for _ in range(1500): con.execute( text(" UNION ".join("SELECT {}".format(i) for i in range(100))) From 63bf914afbaa7bf26d57088bee99d74737ed50ac Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 11:35:21 +0200 Subject: [PATCH 40/70] is this coming from elsewhere? --- .../sqlalchemy/test_sqlalchemy.py | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/tests/integrations/sqlalchemy/test_sqlalchemy.py b/tests/integrations/sqlalchemy/test_sqlalchemy.py index 22ea697152..99d6a5c5fc 100644 --- a/tests/integrations/sqlalchemy/test_sqlalchemy.py +++ b/tests/integrations/sqlalchemy/test_sqlalchemy.py @@ -40,7 +40,9 @@ class Address(Base): person_id = Column(Integer, ForeignKey("person.id")) person = relationship(Person) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -100,7 +102,9 @@ class Address(Base): person_id = Column(Integer, ForeignKey("person.id")) person = relationship(Person) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -171,7 +175,9 @@ class Address(Base): person_id = Column(Integer, ForeignKey("person.id")) person = relationship(Person) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) engine.url = None Base.metadata.create_all(engine) @@ -207,7 +213,9 @@ def test_long_sql_query_preserved(sentry_init, capture_events): ) events = capture_events() - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) with start_transaction(name="test"): with engine.connect() as con: con.execute(text(" UNION ".join("SELECT {}".format(i) for i in range(100)))) @@ -276,7 +284,9 @@ def test_engine_name_not_string(sentry_init): integrations=[SqlalchemyIntegration()], ) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) engine.dialect.name = b"sqlite" with engine.connect() as con: @@ -303,7 +313,9 @@ class Person(Base): id = Column(Integer, primary_key=True) name = Column(String(250), nullable=False) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -353,7 +365,9 @@ class Person(Base): id = Column(Integer, primary_key=True) name = Column(String(250), nullable=False) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -398,7 +412,9 @@ class Person(Base): id = Column(Integer, primary_key=True) name = Column(String(250), nullable=False) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -466,7 +482,9 @@ class Person(Base): id = Column(Integer, primary_key=True) name = Column(String(250), nullable=False) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -522,7 +540,9 @@ class Person(Base): id = Column(Integer, primary_key=True) name = Column(String(250), nullable=False) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 @@ -586,7 +606,9 @@ class Person(Base): id = Column(Integer, primary_key=True) name = Column(String(250), nullable=False) - engine = create_engine("sqlite:///:memory:") + engine = create_engine( + "sqlite:///:memory:", connect_args={"check_same_thread": False} + ) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) # noqa: N806 From 3e02bdf5164e226e352969edee71c80b82bd8b3e Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 11:55:39 +0200 Subject: [PATCH 41/70] trying somethin --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index f736c30496..b9b51fcf3f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short +addopts = --tb=short --reuse-db markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. From 4a6e197fb271d3abc234df07156e0e929c1cc7b1 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:04:10 +0200 Subject: [PATCH 42/70] ? --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index b9b51fcf3f..862724cb1a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short --reuse-db +addopts = --tb=short --create-db markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. From f1117bcf46c2a68f259df47cbffa8ce01b56f908 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:07:38 +0200 Subject: [PATCH 43/70] revert --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 862724cb1a..b9b51fcf3f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short --create-db +addopts = --tb=short --reuse-db markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. From 43c01765ed0f5a678b37891db696e35981bf4a83 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:10:30 +0200 Subject: [PATCH 44/70] more revert --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index b9b51fcf3f..f736c30496 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short --reuse-db +addopts = --tb=short markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. From c9f035fc16ea85fa1e9b6c0feb0c70b4bfd8e893 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:13:52 +0200 Subject: [PATCH 45/70] try reuse-db again --- pytest.ini | 2 +- test-requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index f736c30496..b9b51fcf3f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short +addopts = --tb=short --reuse-db markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. diff --git a/test-requirements.txt b/test-requirements.txt index 0798db0571..29690b5299 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,7 @@ pip pytest pytest-cov +pytest-django pytest-forked pytest-localserver pytest-watch From d5ec5f416a3551d70042ad6e586dcafc2e8a23ce Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:17:38 +0200 Subject: [PATCH 46/70] ? --- pytest.ini | 2 +- test-requirements.txt | 1 - tox.ini | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index b9b51fcf3f..f736c30496 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short --reuse-db +addopts = --tb=short markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. diff --git a/test-requirements.txt b/test-requirements.txt index 29690b5299..0798db0571 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,6 @@ pip pytest pytest-cov -pytest-django pytest-forked pytest-localserver pytest-watch diff --git a/tox.ini b/tox.ini index 61e0fb8930..3b5f35b1fd 100644 --- a/tox.ini +++ b/tox.ini @@ -667,6 +667,7 @@ commands = ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rsfx -s --durations=5 -vvv {env:TESTPATH} {posargs} + django: python -m pytest -rsfx -s --durations=5 -vvv --reuse-db {env:TESTPATH} {posargs} [testenv:linters] commands = From 9e2202c853eca4855ab4d0404331d26f93622662 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:26:28 +0200 Subject: [PATCH 47/70] ? --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index f736c30496..862724cb1a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short +addopts = --tb=short --create-db markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. From 1e36124597e0c98529c5ad921d3049d2c617b8d1 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 12:29:39 +0200 Subject: [PATCH 48/70] revert --- pytest.ini | 2 +- tox.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 862724cb1a..f736c30496 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = tests.integrations.django.myapp.settings -addopts = --tb=short --create-db +addopts = --tb=short markers = tests_internal_exceptions: Handle internal exceptions just as the SDK does, to test it. (Otherwise internal exceptions are recorded and reraised.) only: A temporary marker, to make pytest only run the tests with the mark, similar to jests `it.only`. To use, run `pytest -v -m only`. diff --git a/tox.ini b/tox.ini index 3b5f35b1fd..61e0fb8930 100644 --- a/tox.ini +++ b/tox.ini @@ -667,7 +667,6 @@ commands = ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rsfx -s --durations=5 -vvv {env:TESTPATH} {posargs} - django: python -m pytest -rsfx -s --durations=5 -vvv --reuse-db {env:TESTPATH} {posargs} [testenv:linters] commands = From 123192de9ed84d6a9fb354dc943acb933e87ba9a Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 14:23:18 +0200 Subject: [PATCH 49/70] see pytest output? --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 61e0fb8930..61a601eb5b 100644 --- a/tox.ini +++ b/tox.ini @@ -666,7 +666,7 @@ commands = ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. - {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rsfx -s --durations=5 -vvv {env:TESTPATH} {posargs} + {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rsfx --durations=5 -vvv {env:TESTPATH} {posargs} [testenv:linters] commands = From 2d141e18ee6e26ec4bcab4538fcdf088e211d704 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 14:29:24 +0200 Subject: [PATCH 50/70] more pytest capturing --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 61a601eb5b..8e9a36a5de 100644 --- a/tox.ini +++ b/tox.ini @@ -666,7 +666,7 @@ commands = ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. - {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rsfx --durations=5 -vvv {env:TESTPATH} {posargs} + {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rfx --durations=5 -vvv {env:TESTPATH} {posargs} [testenv:linters] commands = From 87004c78c29cd54f792b759d5c023c5a96934b2e Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 14:34:15 +0200 Subject: [PATCH 51/70] more pytest stuff --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8e9a36a5de..03e04f79e0 100644 --- a/tox.ini +++ b/tox.ini @@ -666,7 +666,7 @@ commands = ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. - {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rfx --durations=5 -vvv {env:TESTPATH} {posargs} + {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rfEs --durations=5 -vvv {env:TESTPATH} {posargs} [testenv:linters] commands = From 1a860131d3466bb663d716926496d527bcb96344 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 14:36:40 +0200 Subject: [PATCH 52/70] wip --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 03e04f79e0..c6263077a6 100644 --- a/tox.ini +++ b/tox.ini @@ -666,7 +666,7 @@ commands = ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. - {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rfEs --durations=5 -vvv {env:TESTPATH} {posargs} + {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rfEs -s --durations=5 -vvv {env:TESTPATH} {posargs} [testenv:linters] commands = From 06167b6e246043c1c00272be31d867e850a0a2e7 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 15:09:14 +0200 Subject: [PATCH 53/70] sanity check --- .github/workflows/test-integrations-web-frameworks-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 4a8f9140bc..7ab1546abd 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -57,7 +57,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install coverage "tox>=3,<4" psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage From 0bbac1dcfbb7ef2fb915373f547357e31f5fd1c3 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Fri, 5 Apr 2024 15:15:01 +0200 Subject: [PATCH 54/70] apparently it isnt tox --- .github/workflows/test-integrations-web-frameworks-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 7ab1546abd..4a8f9140bc 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -57,7 +57,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage "tox>=3,<4" + pip install coverage tox psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage From 2ad00686eea7089b9cca1d2d180ea421332cbd16 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 11:25:16 +0200 Subject: [PATCH 55/70] Run tests in new tooling (#2938) Make sure the Django tests are always run with a unique database name that is cleaned up after the tests have been run. --- .../workflows/test-integrations-databases.yml | 10 ++------ .../test-integrations-web-frameworks-1.yml | 10 ++------ scripts/runtox.sh | 2 +- .../templates/test_group.jinja | 9 ++----- tests/integrations/asyncpg/test_asyncpg.py | 6 ++--- tests/integrations/django/asgi/test_asgi.py | 24 ++++++++++++++----- tests/integrations/django/myapp/settings.py | 10 +++++--- tox.ini | 8 +++---- 8 files changed, 39 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index 3e7f5bfb4f..e037d06a1e 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -46,10 +46,9 @@ jobs: ports: - 5432:5432 env: + SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost SENTRY_PYTHON_TEST_POSTGRES_USER: postgres SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry - SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test - SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost steps: - uses: actions/checkout@v4.1.1 - uses: actions/setup-python@v5 @@ -59,8 +58,6 @@ jobs: - name: Setup Test Env run: | pip install coverage tox - psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true - psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage run: | coverage erase @@ -124,10 +121,9 @@ jobs: ports: - 5432:5432 env: + SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost SENTRY_PYTHON_TEST_POSTGRES_USER: postgres SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry - SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test - SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost steps: - uses: actions/checkout@v4.1.1 - uses: actions/setup-python@v5 @@ -137,8 +133,6 @@ jobs: - name: Setup Test Env run: | pip install coverage tox - psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true - psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 4a8f9140bc..0d6f76442f 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -46,10 +46,9 @@ jobs: ports: - 5432:5432 env: + SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost SENTRY_PYTHON_TEST_POSTGRES_USER: postgres SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry - SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test - SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost steps: - uses: actions/checkout@v4.1.1 - uses: actions/setup-python@v5 @@ -58,8 +57,6 @@ jobs: - name: Setup Test Env run: | pip install coverage tox - psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true - psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage run: | coverage erase @@ -115,10 +112,9 @@ jobs: ports: - 5432:5432 env: + SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost SENTRY_PYTHON_TEST_POSTGRES_USER: postgres SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry - SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test - SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost steps: - uses: actions/checkout@v4.1.1 - uses: actions/setup-python@v5 @@ -127,8 +123,6 @@ jobs: - name: Setup Test Env run: | pip install coverage tox - psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true - psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Erase coverage run: | coverage erase diff --git a/scripts/runtox.sh b/scripts/runtox.sh index dbbb4f2e10..50da44dd53 100755 --- a/scripts/runtox.sh +++ b/scripts/runtox.sh @@ -40,4 +40,4 @@ if [ -z "${ENV}" ]; then exit 0 fi -exec $TOXPATH -vv -e "$ENV" -- "${@:2}" +exec $TOXPATH -e "$ENV" -- "${@:2}" diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index 58692d99d0..07ff88b54e 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -32,10 +32,10 @@ ports: - 5432:5432 env: + SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost SENTRY_PYTHON_TEST_POSTGRES_USER: postgres SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry - SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test - SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost + {% endif %} steps: @@ -56,10 +56,6 @@ - name: Setup Test Env run: | pip install coverage tox - {% if needs_postgres %} - psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true - psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - {% endif %} - name: Erase coverage run: | @@ -69,7 +65,6 @@ - name: Test {{ framework }} {{ category }} run: | set -x # print commands that are executed - {% if category == "pinned" %} ./scripts/runtox.sh --exclude-latest "{% raw %}py${{ matrix.python-version }}{% endraw %}-{{ framework }}" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch {% elif category == "latest" %} diff --git a/tests/integrations/asyncpg/test_asyncpg.py b/tests/integrations/asyncpg/test_asyncpg.py index b0f1645d6b..9140216996 100644 --- a/tests/integrations/asyncpg/test_asyncpg.py +++ b/tests/integrations/asyncpg/test_asyncpg.py @@ -12,11 +12,11 @@ import os -PG_NAME = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_NAME", "postgres") -PG_USER = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_USER", "foo") -PG_PASSWORD = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_PASSWORD", "bar") PG_HOST = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_HOST", "localhost") PG_PORT = 5432 +PG_USER = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_USER", "postgres") +PG_PASSWORD = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_PASSWORD", "sentry") +PG_NAME = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_NAME", "postgres") import datetime from contextlib import contextmanager diff --git a/tests/integrations/django/asgi/test_asgi.py b/tests/integrations/django/asgi/test_asgi.py index 87c85109ef..fd266c4fae 100644 --- a/tests/integrations/django/asgi/test_asgi.py +++ b/tests/integrations/django/asgi/test_asgi.py @@ -133,8 +133,12 @@ async def test_async_views_concurrent_execution(sentry_init, settings): sentry_init(integrations=[DjangoIntegration()], send_default_pii=True) - comm = HttpCommunicator(asgi_application, "GET", "/my_async_view") - comm2 = HttpCommunicator(asgi_application, "GET", "/my_async_view") + comm = HttpCommunicator( + asgi_application, "GET", "/my_async_view" + ) # sleeps for 1 second + comm2 = HttpCommunicator( + asgi_application, "GET", "/my_async_view" + ) # sleeps for 1 second loop = asyncio.get_event_loop() @@ -150,7 +154,9 @@ async def test_async_views_concurrent_execution(sentry_init, settings): assert resp1.result()["status"] == 200 assert resp2.result()["status"] == 200 - assert end - start < 1.5 + assert ( + end - start < 2 + ) # it takes less than 2 seconds so it was ececuting concurrently @pytest.mark.asyncio @@ -171,8 +177,12 @@ async def test_async_middleware_that_is_function_concurrent_execution( sentry_init(integrations=[DjangoIntegration()], send_default_pii=True) - comm = HttpCommunicator(asgi_application, "GET", "/my_async_view") - comm2 = HttpCommunicator(asgi_application, "GET", "/my_async_view") + comm = HttpCommunicator( + asgi_application, "GET", "/my_async_view" + ) # sleeps for 1 second + comm2 = HttpCommunicator( + asgi_application, "GET", "/my_async_view" + ) # sleeps for 1 second loop = asyncio.get_event_loop() @@ -188,7 +198,9 @@ async def test_async_middleware_that_is_function_concurrent_execution( assert resp1.result()["status"] == 200 assert resp2.result()["status"] == 200 - assert end - start < 1.5 + assert ( + end - start < 2 + ) # it takes less than 2 seconds so it was ececuting concurrently @pytest.mark.asyncio diff --git a/tests/integrations/django/myapp/settings.py b/tests/integrations/django/myapp/settings.py index 721cef0984..bcb137e684 100644 --- a/tests/integrations/django/myapp/settings.py +++ b/tests/integrations/django/myapp/settings.py @@ -10,6 +10,8 @@ https://docs.djangoproject.com/en/2.0/ref/settings/ """ +import random + # We shouldn't access settings while setting up integrations. Initialize SDK # here to provoke any errors that might occur. import sentry_sdk @@ -121,11 +123,13 @@ def middleware(request): DATABASES["postgres"] = { "ENGINE": db_engine, - "NAME": os.environ["SENTRY_PYTHON_TEST_POSTGRES_NAME"], - "USER": os.environ["SENTRY_PYTHON_TEST_POSTGRES_USER"], - "PASSWORD": os.environ["SENTRY_PYTHON_TEST_POSTGRES_PASSWORD"], "HOST": os.environ.get("SENTRY_PYTHON_TEST_POSTGRES_HOST", "localhost"), "PORT": 5432, + "USER": os.environ.get("SENTRY_PYTHON_TEST_POSTGRES_USER", "postgres"), + "PASSWORD": os.environ.get("SENTRY_PYTHON_TEST_POSTGRES_PASSWORD", "sentry"), + "NAME": os.environ.get( + "SENTRY_PYTHON_TEST_POSTGRES_NAME", f"myapp_db_{random.randint(0, 1000)}" + ), } except (ImportError, KeyError): from sentry_sdk.utils import logger diff --git a/tox.ini b/tox.ini index c6263077a6..e193de52b1 100644 --- a/tox.ini +++ b/tox.ini @@ -342,8 +342,8 @@ deps = django-v{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: djangorestframework>=3.0.0,<4.0.0 django-v{2.0,2.2,3.0,3.2,4.0,4.1,4.2,5.0}: channels[daphne] django-v{1.11,2.0,2.2,3.0,3.2}: Werkzeug<2.1.0 - django-v{1.11,2.0}: pytest-django<4.0 - django-v{2.2,3.0,3.2,4.0,4.1,4.2,5.0}: pytest-django + django-v{1.11,2.0,2.2,3.0}: pytest-django<4.0 + django-v{3.2,4.0,4.1,4.2,5.0}: pytest-django django-v{4.0,4.1,4.2,5.0}: djangorestframework django-v{4.0,4.1,4.2,5.0}: pytest-asyncio<=0.21.1 django-v{4.0,4.1,4.2,5.0}: Werkzeug @@ -630,10 +630,10 @@ setenv = passenv = SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY + SENTRY_PYTHON_TEST_POSTGRES_HOST SENTRY_PYTHON_TEST_POSTGRES_USER SENTRY_PYTHON_TEST_POSTGRES_PASSWORD SENTRY_PYTHON_TEST_POSTGRES_NAME - SENTRY_PYTHON_TEST_POSTGRES_HOST usedevelop = True extras = bottle: bottle @@ -666,7 +666,7 @@ commands = ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. - {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12}: python -m pytest -rfEs -s --durations=5 -vvv {env:TESTPATH} {posargs} + python -m pytest -rfEs -s --durations=5 -vvv {env:TESTPATH} {posargs} [testenv:linters] commands = From bf65327264da84cae81e3eb08ff293ef3ef1c611 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Mon, 8 Apr 2024 11:38:38 +0200 Subject: [PATCH 56/70] another sanity check --- test-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 0798db0571..dae2f5c356 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,9 +4,9 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -tox -#tox; python_version<'3.12' -#tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI +#tox +tox; python_version<'3.12' +tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent executing From e1f2ec1cd966980cd5fd4f8d986f8bfd2e766294 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Mon, 8 Apr 2024 11:48:03 +0200 Subject: [PATCH 57/70] ? --- test-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index dae2f5c356..de54d31891 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,8 +5,8 @@ pytest-forked pytest-localserver pytest-watch #tox -tox; python_version<'3.12' -tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI +#tox; python_version<'3.12' +#tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent executing From 46c54381bb154828dee88f324150184cd69a5079 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Mon, 8 Apr 2024 11:49:11 +0200 Subject: [PATCH 58/70] verbosity --- scripts/runtox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtox.sh b/scripts/runtox.sh index 50da44dd53..9150117f27 100755 --- a/scripts/runtox.sh +++ b/scripts/runtox.sh @@ -40,4 +40,4 @@ if [ -z "${ENV}" ]; then exit 0 fi -exec $TOXPATH -e "$ENV" -- "${@:2}" +exec $TOXPATH -v -e "$ENV" -- "${@:2}" From f89432a5cea26ded3f7c825425f79326344bde61 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Mon, 8 Apr 2024 11:56:10 +0200 Subject: [PATCH 59/70] remove tox from test-requirements --- test-requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index de54d31891..15f150097d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,9 +4,6 @@ pytest-cov pytest-forked pytest-localserver pytest-watch -#tox -#tox; python_version<'3.12' -#tox<4; python_version>='3.12' # TODO: >=4 makes async django tests hang in CI jsonschema pyrsistent executing From 7571be8c0cd67628713a66d1c0b7d4408f8d21d6 Mon Sep 17 00:00:00 2001 From: Ivana Kellyerova Date: Mon, 8 Apr 2024 11:58:15 +0200 Subject: [PATCH 60/70] ok this is too much --- scripts/runtox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runtox.sh b/scripts/runtox.sh index 9150117f27..50da44dd53 100755 --- a/scripts/runtox.sh +++ b/scripts/runtox.sh @@ -40,4 +40,4 @@ if [ -z "${ENV}" ]; then exit 0 fi -exec $TOXPATH -v -e "$ENV" -- "${@:2}" +exec $TOXPATH -e "$ENV" -- "${@:2}" From c89482ea0673a498e348cc16b8127bffbfcefd95 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 15:38:24 +0200 Subject: [PATCH 61/70] Trying uv in makefile --- Makefile | 34 +++++++++++++++++-------------- scripts/build_aws_lambda_layer.py | 2 -- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 29f511e502..4647cf27f8 100644 --- a/Makefile +++ b/Makefile @@ -15,22 +15,26 @@ help: @false .venv: - virtualenv -ppython3 $(VENV_PATH) - $(VENV_PATH)/bin/pip install tox + pip install uv + uv venv $(VENV_PATH) + . $(VENV_PATH)/bin/activate + uv pip install tox tox-uv dist: .venv rm -rf dist dist-serverless build - $(VENV_PATH)/bin/pip install wheel setuptools - $(VENV_PATH)/bin/python setup.py sdist bdist_wheel + uv pip install wheel setuptools + python setup.py sdist bdist_wheel + .PHONY: dist format: .venv - $(VENV_PATH)/bin/tox -e linters --notest - .tox/linters/bin/black . + uv pip install black + black . + .PHONY: format test: .venv - @$(VENV_PATH)/bin/tox -e py3.12 + tox -e py3.12 .PHONY: test test-all: .venv @@ -41,7 +45,7 @@ check: lint test .PHONY: check lint: .venv - @set -e && $(VENV_PATH)/bin/tox -e linters || ( \ + @set -e && tox -e linters || ( \ echo "================================"; \ echo "Bad formatting? Run: make format"; \ echo "================================"; \ @@ -49,18 +53,18 @@ lint: .venv .PHONY: lint apidocs: .venv - @$(VENV_PATH)/bin/pip install --editable . - @$(VENV_PATH)/bin/pip install -U -r ./docs-requirements.txt + uv pip install --editable . + uv pip install -U -r ./docs-requirements.txt rm -rf docs/_build - @$(VENV_PATH)/bin/sphinx-build -vv -W -b html docs/ docs/_build + @sphinx-build -vv -W -b html docs/ docs/_build .PHONY: apidocs apidocs-hotfix: apidocs - @$(VENV_PATH)/bin/pip install ghp-import - @$(VENV_PATH)/bin/ghp-import -pf docs/_build + uv pip install ghp-import + @ghp-import -pf docs/_build .PHONY: apidocs-hotfix aws-lambda-layer: dist - $(VENV_PATH)/bin/pip install -r aws-lambda-layer-requirements.txt - $(VENV_PATH)/bin/python -m scripts.build_aws_lambda_layer + uv pip install -r aws-lambda-layer-requirements.txt + python -m scripts.build_aws_lambda_layer .PHONY: aws-lambda-layer diff --git a/scripts/build_aws_lambda_layer.py b/scripts/build_aws_lambda_layer.py index c2cb46f0bb..8ffeb336cb 100644 --- a/scripts/build_aws_lambda_layer.py +++ b/scripts/build_aws_lambda_layer.py @@ -39,8 +39,6 @@ def install_python_packages(self): # because Lambda does not support the newest versions of some packages) subprocess.check_call( [ - sys.executable, - "-m", "pip", "install", "-r", From bbc69aa3eb6ae2046a57f18462aff7e843f635eb Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 15:42:46 +0200 Subject: [PATCH 62/70] Using uv in github actions --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/test-integrations-aws-lambda.yml | 3 ++- .github/workflows/test-integrations-cloud-computing.yml | 6 ++++-- .github/workflows/test-integrations-common.yml | 3 ++- .github/workflows/test-integrations-data-processing.yml | 6 ++++-- .github/workflows/test-integrations-databases.yml | 6 ++++-- .github/workflows/test-integrations-graphql.yml | 6 ++++-- .github/workflows/test-integrations-miscellaneous.yml | 6 ++++-- .github/workflows/test-integrations-networking.yml | 6 ++++-- .github/workflows/test-integrations-web-frameworks-1.yml | 6 ++++-- .github/workflows/test-integrations-web-frameworks-2.yml | 6 ++++-- scripts/split-tox-gh-actions/templates/test_group.jinja | 3 ++- tox.ini | 4 ++-- 13 files changed, 44 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c56f87ca03..50e41aab76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,8 @@ jobs: python-version: 3.12 - run: | - pip install tox + pip install uv + uv pip install tox tox-uv tox -e linters check-ci-config: @@ -45,7 +46,8 @@ jobs: python-version: 3.12 - run: | - pip install jinja2 + pip install uv + uv pip install jinja2 python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes build_lambda_layer: @@ -67,7 +69,6 @@ jobs: - name: Build Packages run: | echo "Creating directory containing Python SDK Lambda Layer" - pip install virtualenv # This will also trigger "make dist" that creates the Python packages make aws-lambda-layer - name: Upload Python Packages @@ -89,7 +90,6 @@ jobs: python-version: 3.12 - run: | - pip install virtualenv make apidocs cd docs/_build && zip -r gh-pages ./ diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws-lambda.yml index b8a453b50f..c3113fae0b 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws-lambda.yml @@ -73,7 +73,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud-computing.yml index 62bdbcf6f5..cf9ddcdeee 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud-computing.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +87,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index c15446533b..8eaae904b3 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-data-processing.yml index 51cd986736..cd5910dd55 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-data-processing.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -94,7 +95,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index e037d06a1e..ca060b703a 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -57,7 +57,8 @@ jobs: - uses: getsentry/action-clickhouse-in-ci@v1 - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -132,7 +133,8 @@ jobs: - uses: getsentry/action-clickhouse-in-ci@v1 - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index ffad9d78df..ce5dabd017 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +87,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-miscellaneous.yml index c8bae41e26..5042968573 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-miscellaneous.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +87,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-networking.yml index 51837cc73b..f9402d6551 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-networking.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -86,7 +87,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 0d6f76442f..8672b962b8 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -56,7 +56,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -122,7 +123,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-frameworks-2.yml index 4222c8b501..0529de2e37 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-frameworks-2.yml @@ -38,7 +38,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase @@ -106,7 +107,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | coverage erase diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index 07ff88b54e..c47042d197 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -55,7 +55,8 @@ - name: Setup Test Env run: | - pip install coverage tox + pip install uv + uv pip install coverage tox - name: Erase coverage run: | diff --git a/tox.ini b/tox.ini index e193de52b1..637075a2b1 100644 --- a/tox.ini +++ b/tox.ini @@ -658,10 +658,10 @@ basepython = linters: python3.12 commands = - {py3.7,py3.8}-boto3: pip install urllib3<2.0.0 + {py3.7,py3.8}-boto3: uv pip install urllib3<2.0.0 ; https://github.com/pallets/flask/issues/4455 - {py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1" + {py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: uv pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1" ; Running `py.test` as an executable suffers from an import error ; when loading tests in scenarios. In particular, django fails to From 8af2d85d955f90b085a27c2d226e6f16916fd554 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 15:52:55 +0200 Subject: [PATCH 63/70] Virtualenv everywhere --- .github/workflows/ci.yml | 3 +-- .github/workflows/test-integrations-aws-lambda.yml | 2 ++ .github/workflows/test-integrations-cloud-computing.yml | 4 ++++ .github/workflows/test-integrations-common.yml | 2 ++ .github/workflows/test-integrations-data-processing.yml | 4 ++++ .github/workflows/test-integrations-databases.yml | 4 ++++ .github/workflows/test-integrations-graphql.yml | 4 ++++ .github/workflows/test-integrations-miscellaneous.yml | 4 ++++ .github/workflows/test-integrations-networking.yml | 4 ++++ .github/workflows/test-integrations-web-frameworks-1.yml | 4 ++++ .github/workflows/test-integrations-web-frameworks-2.yml | 4 ++++ scripts/split-tox-gh-actions/templates/test_group.jinja | 2 ++ 12 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50e41aab76..16eb686afb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,7 @@ jobs: python-version: 3.12 - run: | - pip install uv - uv pip install tox tox-uv + pip install tox tox-uv tox -e linters check-ci-config: diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws-lambda.yml index c3113fae0b..a6b4f977dd 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws-lambda.yml @@ -74,6 +74,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud-computing.yml index cf9ddcdeee..2df2de8a65 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud-computing.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -88,6 +90,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index 8eaae904b3..3f02bd93b6 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-data-processing.yml index cd5910dd55..5800a2311b 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-data-processing.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -96,6 +98,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index ca060b703a..341d5c2452 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -58,6 +58,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -134,6 +136,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index ce5dabd017..1542834e85 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -88,6 +90,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-miscellaneous.yml index 5042968573..52da9c4ca0 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-miscellaneous.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -88,6 +90,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-networking.yml index f9402d6551..dacfb1efaa 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-networking.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -88,6 +90,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 8672b962b8..115037a6f7 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -57,6 +57,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -124,6 +126,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-frameworks-2.yml index 0529de2e37..af5615e5d2 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-frameworks-2.yml @@ -39,6 +39,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | @@ -108,6 +110,8 @@ jobs: - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage run: | diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index c47042d197..e2a0c71e84 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -56,6 +56,8 @@ - name: Setup Test Env run: | pip install uv + uv venv + . .venv/bin/activate uv pip install coverage tox - name: Erase coverage From 793551a7ad881b5716d02809ca0c68dc44574823 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:02:03 +0200 Subject: [PATCH 64/70] apidocs --- .github/workflows/ci.yml | 2 ++ Makefile | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16eb686afb..d02533845e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,8 @@ jobs: - run: | pip install uv + uv venv + . .venv/bin/activate uv pip install jinja2 python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes diff --git a/Makefile b/Makefile index 4647cf27f8..552dd024b7 100644 --- a/Makefile +++ b/Makefile @@ -56,12 +56,12 @@ apidocs: .venv uv pip install --editable . uv pip install -U -r ./docs-requirements.txt rm -rf docs/_build - @sphinx-build -vv -W -b html docs/ docs/_build + sphinx-build -vv -W -b html docs/ docs/_build .PHONY: apidocs apidocs-hotfix: apidocs uv pip install ghp-import - @ghp-import -pf docs/_build + ghp-import -pf docs/_build .PHONY: apidocs-hotfix aws-lambda-layer: dist From 52f6db18ad3f9639deb9add525598211bb6ccc28 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:05:16 +0200 Subject: [PATCH 65/70] Erase coverage in setup step (does not make sense to have separate step for this) --- .github/workflows/test-integrations-aws-lambda.yml | 2 -- .github/workflows/test-integrations-cloud-computing.yml | 4 ---- .github/workflows/test-integrations-common.yml | 2 -- .github/workflows/test-integrations-data-processing.yml | 4 ---- .github/workflows/test-integrations-databases.yml | 4 ---- .github/workflows/test-integrations-graphql.yml | 4 ---- .github/workflows/test-integrations-miscellaneous.yml | 4 ---- .github/workflows/test-integrations-networking.yml | 4 ---- .github/workflows/test-integrations-web-frameworks-1.yml | 4 ---- .github/workflows/test-integrations-web-frameworks-2.yml | 4 ---- scripts/split-tox-gh-actions/templates/test_group.jinja | 3 --- 11 files changed, 39 deletions(-) diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws-lambda.yml index a6b4f977dd..81979a0d06 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws-lambda.yml @@ -77,8 +77,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test aws_lambda pinned run: | diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud-computing.yml index 2df2de8a65..c7f1ffc0be 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud-computing.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test boto3 latest run: | @@ -93,8 +91,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test boto3 pinned run: | diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index 3f02bd93b6..3147840be4 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test common pinned run: | diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-data-processing.yml index 5800a2311b..a083c8c433 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-data-processing.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test arq latest run: | @@ -101,8 +99,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test arq pinned run: | diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index 341d5c2452..3903998343 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -61,8 +61,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test asyncpg latest run: | @@ -139,8 +137,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test asyncpg pinned run: | diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index 1542834e85..bf4a22aaf5 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test ariadne latest run: | @@ -93,8 +91,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test ariadne pinned run: | diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-miscellaneous.yml index 52da9c4ca0..8fa924ffd8 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-miscellaneous.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test loguru latest run: | @@ -93,8 +91,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test loguru pinned run: | diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-networking.yml index dacfb1efaa..b20ea489dc 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-networking.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test gevent latest run: | @@ -93,8 +91,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test gevent pinned run: | diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 115037a6f7..99884d041f 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -60,8 +60,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test django latest run: | @@ -129,8 +127,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test django pinned run: | diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-frameworks-2.yml index af5615e5d2..0e01dc8cb1 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-frameworks-2.yml @@ -42,8 +42,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test aiohttp latest run: | @@ -113,8 +111,6 @@ jobs: uv venv . .venv/bin/activate uv pip install coverage tox - - name: Erase coverage - run: | coverage erase - name: Test aiohttp pinned run: | diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index e2a0c71e84..d967d39aca 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -59,9 +59,6 @@ uv venv . .venv/bin/activate uv pip install coverage tox - - - name: Erase coverage - run: | coverage erase {% for framework in frameworks %} From 8ab2b5d248ff2cc31d08235a2ad9c3e502366252 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:09:35 +0200 Subject: [PATCH 66/70] use virtualenv when generating coverage file --- .github/workflows/test-integrations-aws-lambda.yml | 1 + .github/workflows/test-integrations-cloud-computing.yml | 2 ++ .github/workflows/test-integrations-common.yml | 1 + .github/workflows/test-integrations-data-processing.yml | 2 ++ .github/workflows/test-integrations-databases.yml | 2 ++ .github/workflows/test-integrations-graphql.yml | 2 ++ .github/workflows/test-integrations-miscellaneous.yml | 2 ++ .github/workflows/test-integrations-networking.yml | 2 ++ .github/workflows/test-integrations-web-frameworks-1.yml | 2 ++ .github/workflows/test-integrations-web-frameworks-2.yml | 2 ++ scripts/split-tox-gh-actions/templates/test_group.jinja | 1 + 11 files changed, 19 insertions(+) diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws-lambda.yml index 81979a0d06..d6c0409093 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws-lambda.yml @@ -84,6 +84,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud-computing.yml index c7f1ffc0be..21d55758d0 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud-computing.yml @@ -61,6 +61,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-gcp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -110,6 +111,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index 3147840be4..0e2534d130 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -49,6 +49,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-data-processing.yml index a083c8c433..a39a5dd904 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-data-processing.yml @@ -69,6 +69,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-rq-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -126,6 +127,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index 3903998343..3d00eec7e0 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -88,6 +88,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-sqlalchemy-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -164,6 +165,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-sqlalchemy" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index bf4a22aaf5..c1c53463ad 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -61,6 +61,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-strawberry-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -110,6 +111,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-strawberry" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-miscellaneous.yml index 8fa924ffd8..b038647353 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-miscellaneous.yml @@ -61,6 +61,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-trytond-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -110,6 +111,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-trytond" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-networking.yml index b20ea489dc..ef8048d396 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-networking.yml @@ -61,6 +61,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-requests-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -110,6 +111,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-requests" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 99884d041f..3052dec0db 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -79,6 +79,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-fastapi-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -146,6 +147,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-fastapi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-frameworks-2.yml index 0e01dc8cb1..06117faac1 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-frameworks-2.yml @@ -81,6 +81,7 @@ jobs: ./scripts/runtox.sh "py${{ matrix.python-version }}-tornado-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 @@ -150,6 +151,7 @@ jobs: ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-tornado" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i - uses: codecov/codecov-action@v4 diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index d967d39aca..137ffa90ab 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -74,6 +74,7 @@ - name: Generate coverage XML run: | + . .venv/bin/activate coverage combine .coverage* coverage xml -i From e1b764891f368e8ff8a90bab9b05cfb7a6331504 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:18:26 +0200 Subject: [PATCH 67/70] More uv in tox --- .../test-integrations-aws-lambda.yml | 3 ++- .../test-integrations-cloud-computing.yml | 12 ++++++++-- .../workflows/test-integrations-common.yml | 3 ++- .../test-integrations-data-processing.yml | 16 ++++++++++++-- .../workflows/test-integrations-databases.yml | 16 ++++++++++++-- .../workflows/test-integrations-graphql.yml | 12 ++++++++-- .../test-integrations-miscellaneous.yml | 12 ++++++++-- .../test-integrations-networking.yml | 12 ++++++++-- .../test-integrations-web-frameworks-1.yml | 12 ++++++++-- .../test-integrations-web-frameworks-2.yml | 22 +++++++++++++++++-- .../templates/test_group.jinja | 3 ++- 11 files changed, 104 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws-lambda.yml index d6c0409093..67b7d9826a 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws-lambda.yml @@ -76,11 +76,12 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test aws_lambda pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud-computing.yml index 21d55758d0..b057d60cbf 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud-computing.yml @@ -41,23 +41,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test boto3 latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-boto3-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test chalice latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-chalice-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test cloud_resource_context latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-cloud_resource_context-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test gcp latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-gcp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -91,23 +95,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test boto3 pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test chalice pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-chalice" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test cloud_resource_context pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cloud_resource_context" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test gcp pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-common.yml b/.github/workflows/test-integrations-common.yml index 0e2534d130..67f7f5d873 100644 --- a/.github/workflows/test-integrations-common.yml +++ b/.github/workflows/test-integrations-common.yml @@ -41,11 +41,12 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test common pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-data-processing.yml index a39a5dd904..3faf806aba 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-data-processing.yml @@ -41,31 +41,37 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test arq latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-arq-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test beam latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-beam-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test celery latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-celery-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test huey latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-huey-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test openai latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-openai-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test rq latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-rq-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -99,31 +105,37 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test arq pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-arq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test beam pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-beam" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test celery pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-celery" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test huey pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huey" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test openai pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test rq pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-databases.yml index 3d00eec7e0..aead5c9dea 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-databases.yml @@ -60,31 +60,37 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test asyncpg latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-asyncpg-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test clickhouse_driver latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-clickhouse_driver-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test pymongo latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-pymongo-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test redis latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-redis-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test rediscluster latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-rediscluster-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test sqlalchemy latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-sqlalchemy-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -137,31 +143,37 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test asyncpg pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asyncpg" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test clickhouse_driver pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-clickhouse_driver" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test pymongo pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pymongo" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test redis pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test rediscluster pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test sqlalchemy pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-sqlalchemy" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-graphql.yml b/.github/workflows/test-integrations-graphql.yml index c1c53463ad..e5a56c947f 100644 --- a/.github/workflows/test-integrations-graphql.yml +++ b/.github/workflows/test-integrations-graphql.yml @@ -41,23 +41,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test ariadne latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-ariadne-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test gql latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-gql-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test graphene latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-graphene-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test strawberry latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-strawberry-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -91,23 +95,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test ariadne pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-ariadne" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test gql pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gql" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test graphene pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-graphene" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test strawberry pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-strawberry" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-miscellaneous.yml index b038647353..c312265f30 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-miscellaneous.yml @@ -41,23 +41,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test loguru latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-loguru-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test opentelemetry latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-opentelemetry-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test pure_eval latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-pure_eval-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test trytond latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-trytond-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -91,23 +95,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test loguru pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-loguru" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test opentelemetry pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-opentelemetry" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test pure_eval pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pure_eval" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test trytond pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-trytond" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-networking.yml index ef8048d396..7681f8c744 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-networking.yml @@ -41,23 +41,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test gevent latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-gevent-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test grpc latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-grpc-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test httpx latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-httpx-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test requests latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-requests-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -91,23 +95,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test gevent pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gevent" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test grpc pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-grpc" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test httpx pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-httpx" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test requests pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-requests" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 3052dec0db..e77210596e 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -59,23 +59,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test django latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-django-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test flask latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-flask-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test starlette latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-starlette-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test fastapi latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-fastapi-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -127,23 +131,27 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test django pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-django" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test flask pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-flask" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test starlette pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-starlette" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test fastapi pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-fastapi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-frameworks-2.yml index 06117faac1..15d718e12b 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-frameworks-2.yml @@ -41,43 +41,52 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test aiohttp latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-aiohttp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test asgi latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-asgi-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test bottle latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-bottle-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test falcon latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-falcon-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test pyramid latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-pyramid-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test quart latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-quart-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test sanic latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-sanic-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test starlite latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-starlite-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test tornado latest run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh "py${{ matrix.python-version }}-tornado-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | @@ -111,43 +120,52 @@ jobs: pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase - name: Test aiohttp pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aiohttp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test asgi pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asgi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test bottle pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-bottle" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test falcon pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-falcon" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test pyramid pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pyramid" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test quart pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-quart" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test sanic pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-sanic" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test starlite pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-starlite" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test tornado pinned run: | set -x # print commands that are executed + . .venv/bin/activate ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-tornado" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Generate coverage XML run: | diff --git a/scripts/split-tox-gh-actions/templates/test_group.jinja b/scripts/split-tox-gh-actions/templates/test_group.jinja index 137ffa90ab..dc4d36bd35 100644 --- a/scripts/split-tox-gh-actions/templates/test_group.jinja +++ b/scripts/split-tox-gh-actions/templates/test_group.jinja @@ -58,13 +58,14 @@ pip install uv uv venv . .venv/bin/activate - uv pip install coverage tox + uv pip install coverage tox tox-uv coverage erase {% for framework in frameworks %} - name: Test {{ framework }} {{ category }} run: | set -x # print commands that are executed + . .venv/bin/activate {% if category == "pinned" %} ./scripts/runtox.sh --exclude-latest "{% raw %}py${{ matrix.python-version }}{% endraw %}-{{ framework }}" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch {% elif category == "latest" %} From 421df18d4ab086aaee5433894309cc5c0c1d3eb7 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:27:27 +0200 Subject: [PATCH 68/70] debug output --- .github/workflows/test-integrations-web-frameworks-1.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index e77210596e..8ee76e954b 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -136,7 +136,8 @@ jobs: - name: Test django pinned run: | set -x # print commands that are executed - . .venv/bin/activate + uv pip list + which tox ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-django" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test flask pinned run: | From 54712a4f26926286b41976311fa9cc791f23e421 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:31:06 +0200 Subject: [PATCH 69/70] debug output --- .github/workflows/test-integrations-web-frameworks-1.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 8ee76e954b..934fe59964 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -136,7 +136,9 @@ jobs: - name: Test django pinned run: | set -x # print commands that are executed + . .venv/bin/activate uv pip list + tox -v which tox ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-django" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test flask pinned From b8f824295597c7d68d8a5450b4c55815ebc299e5 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Mon, 8 Apr 2024 16:44:36 +0200 Subject: [PATCH 70/70] debug output --- .github/workflows/test-integrations-web-frameworks-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-frameworks-1.yml index 934fe59964..e454f166c6 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-frameworks-1.yml @@ -138,7 +138,7 @@ jobs: set -x # print commands that are executed . .venv/bin/activate uv pip list - tox -v + tox --version which tox ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-django" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch - name: Test flask pinned