Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Constraints upgrades: sentry-sdk and fix tests #1182

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions package/tests/test_PartSeg/test_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ def test_sentry_serialize_clip(monkeypatch):


def test_sentry_variables_clip(monkeypatch):
letters = "abcdefghijklmnoprst"
for letter in letters:
locals()[letter] = 1
try:
raise ValueError("eeee")
except ValueError as ee:
event, _hint = sentry_sdk.utils.event_from_exception(ee)
clipped = serialize(event)
assert (
len(clipped["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"])
== sentry_sdk.serializer.MAX_DATABAG_BREADTH
)


def test_sentry_variables_clip_change_breadth(monkeypatch):
monkeypatch.setattr(sentry_sdk.serializer, "MAX_DATABAG_BREADTH", 100)
letters = "abcdefghijklmnoprst"
for letter in letters:
locals()[letter] = 1
Expand All @@ -57,13 +73,10 @@ def test_sentry_variables_clip(monkeypatch):
vars_dict = event["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"]
for letter in letters:
assert letter in vars_dict
clipped = serialize(event)
assert len(clipped["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"]) == 10
monkeypatch.setattr(sentry_sdk.serializer, "MAX_DATABAG_BREADTH", 100)

clipped = serialize(event)
assert len(clipped["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"]) == len(vars_dict)
assert len(clipped["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"]) > 10

client = Client("https://[email protected]/77")
Hub.current.bind_client(client)
sentry_sdk.capture_event(event, hint=hint)
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.10_pydantic_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,11 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,11 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints_py3.11_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.11_pydantic_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,11 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.12_pydantic_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ scipy==1.14.0
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,11 @@ scipy==1.10.1
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.8_pydantic_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,11 @@ scipy==1.10.1
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ scipy==1.13.1
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
4 changes: 2 additions & 2 deletions requirements/constraints_py3.9_pydantic_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ scipy==1.13.1
# partseg (pyproject.toml)
# napari
# scikit-image
sentry-sdk==2.12.0
sentry-sdk==2.13.0
# via
# -r requirements/version_denylist.txt
# partseg (pyproject.toml)
setuptools==72.1.0
setuptools==72.2.0
# via
# pyinstaller
# pyinstaller-hooks-contrib
Expand Down
Loading