Skip to content

Commit 95c72e9

Browse files
authored
Merge branch 'master' into aliu/unleash
2 parents cffb475 + 7f73c9e commit 95c72e9

File tree

4 files changed

+35
-20
lines changed

4 files changed

+35
-20
lines changed

.github/workflows/test-integrations-web-2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.6","3.7","3.8","3.11","3.12","3.13"]
32+
python-version: ["3.6","3.7","3.8","3.9","3.11","3.12","3.13"]
3333
# python3.6 reached EOL and is no longer being supported on
3434
# new versions of hosted runners on Github Actions
3535
# ubuntu-20.04 is the last version that supported python3.6

sentry_sdk/integrations/arq.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def setup_once():
7171
def patch_enqueue_job():
7272
# type: () -> None
7373
old_enqueue_job = ArqRedis.enqueue_job
74+
original_kwdefaults = old_enqueue_job.__kwdefaults__
7475

7576
async def _sentry_enqueue_job(self, function, *args, **kwargs):
7677
# type: (ArqRedis, str, *Any, **Any) -> Optional[Job]
@@ -83,6 +84,7 @@ async def _sentry_enqueue_job(self, function, *args, **kwargs):
8384
):
8485
return await old_enqueue_job(self, function, *args, **kwargs)
8586

87+
_sentry_enqueue_job.__kwdefaults__ = original_kwdefaults
8688
ArqRedis.enqueue_job = _sentry_enqueue_job
8789

8890

tests/integrations/launchdarkly/test_launchdarkly.py

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ def test_launchdarkly_integration(
2222
sentry_init, use_global_client, capture_events, uninstall_integration
2323
):
2424
td = TestData.data_source()
25-
config = Config("sdk-key", update_processor_class=td)
25+
td.update(td.flag("hello").variation_for_all(True))
26+
td.update(td.flag("world").variation_for_all(True))
27+
# Disable background requests as we aren't using a server.
28+
config = Config(
29+
"sdk-key", update_processor_class=td, diagnostic_opt_out=True, send_events=False
30+
)
2631

2732
uninstall_integration(LaunchDarklyIntegration.identifier)
2833
if use_global_client:
@@ -33,10 +38,6 @@ def test_launchdarkly_integration(
3338
client = LDClient(config=config)
3439
sentry_init(integrations=[LaunchDarklyIntegration(ld_client=client)])
3540

36-
# Set test values
37-
td.update(td.flag("hello").variation_for_all(True))
38-
td.update(td.flag("world").variation_for_all(True))
39-
4041
# Evaluate
4142
client.variation("hello", Context.create("my-org", "organization"), False)
4243
client.variation("world", Context.create("user1", "user"), False)
@@ -59,7 +60,16 @@ def test_launchdarkly_integration_threaded(
5960
sentry_init, capture_events, uninstall_integration
6061
):
6162
td = TestData.data_source()
62-
client = LDClient(config=Config("sdk-key", update_processor_class=td))
63+
td.update(td.flag("hello").variation_for_all(True))
64+
td.update(td.flag("world").variation_for_all(True))
65+
client = LDClient(
66+
config=Config(
67+
"sdk-key",
68+
update_processor_class=td,
69+
diagnostic_opt_out=True, # Disable background requests as we aren't using a server.
70+
send_events=False,
71+
)
72+
)
6373
context = Context.create("user1")
6474

6575
uninstall_integration(LaunchDarklyIntegration.identifier)
@@ -75,8 +85,6 @@ def task(flag_key):
7585
sentry_sdk.set_tag("task_id", flag_key)
7686
sentry_sdk.capture_exception(Exception("something wrong!"))
7787

78-
td.update(td.flag("hello").variation_for_all(True))
79-
td.update(td.flag("world").variation_for_all(False))
8088
# Capture an eval before we split isolation scopes.
8189
client.variation("hello", context, False)
8290

@@ -104,7 +112,7 @@ def task(flag_key):
104112
assert events[2]["contexts"]["flags"] == {
105113
"values": [
106114
{"flag": "hello", "result": True},
107-
{"flag": "world", "result": False},
115+
{"flag": "world", "result": True},
108116
]
109117
}
110118

@@ -118,7 +126,16 @@ def test_launchdarkly_integration_asyncio(
118126
asyncio = pytest.importorskip("asyncio")
119127

120128
td = TestData.data_source()
121-
client = LDClient(config=Config("sdk-key", update_processor_class=td))
129+
td.update(td.flag("hello").variation_for_all(True))
130+
td.update(td.flag("world").variation_for_all(True))
131+
client = LDClient(
132+
config=Config(
133+
"sdk-key",
134+
update_processor_class=td,
135+
diagnostic_opt_out=True, # Disable background requests as we aren't using a server.
136+
send_events=False,
137+
)
138+
)
122139
context = Context.create("user1")
123140

124141
uninstall_integration(LaunchDarklyIntegration.identifier)
@@ -135,8 +152,6 @@ async def task(flag_key):
135152
async def runner():
136153
return asyncio.gather(task("world"), task("other"))
137154

138-
td.update(td.flag("hello").variation_for_all(True))
139-
td.update(td.flag("world").variation_for_all(False))
140155
# Capture an eval before we split isolation scopes.
141156
client.variation("hello", context, False)
142157

@@ -163,7 +178,7 @@ async def runner():
163178
assert events[2]["contexts"]["flags"] == {
164179
"values": [
165180
{"flag": "hello", "result": True},
166-
{"flag": "world", "result": False},
181+
{"flag": "world", "result": True},
167182
]
168183
}
169184

tox.ini

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,8 @@ envlist =
247247
# Sanic
248248
{py3.6,py3.7}-sanic-v{0.8}
249249
{py3.6,py3.8}-sanic-v{20}
250-
{py3.7,py3.11}-sanic-v{22}
251-
{py3.7,py3.11}-sanic-v{23}
252-
{py3.8,py3.11,py3.12}-sanic-latest
250+
{py3.8,py3.11,py3.12}-sanic-v{24.6}
251+
{py3.9,py3.12,py3.13}-sanic-latest
253252

254253
# Spark
255254
{py3.8,py3.10,py3.11}-spark-v{3.1,3.3,3.5}
@@ -660,13 +659,12 @@ deps =
660659
# Sanic
661660
sanic: websockets<11.0
662661
sanic: aiohttp
663-
sanic-v{22,23}: sanic_testing
662+
sanic-v{24.6}: sanic_testing
664663
sanic-latest: sanic_testing
665664
{py3.6}-sanic: aiocontextvars==0.2.1
666665
sanic-v0.8: sanic~=0.8.0
667666
sanic-v20: sanic~=20.0
668-
sanic-v22: sanic~=22.0
669-
sanic-v23: sanic~=23.0
667+
sanic-v24.6: sanic~=24.6.0
670668
sanic-latest: sanic
671669

672670
# Spark

0 commit comments

Comments
 (0)