Skip to content

Commit

Permalink
Update sentry-related tests and stop checking versions
Browse files Browse the repository at this point in the history
This updates the sentry-related tests to match the event payload. It
also changes the tests so they no ignore the sentry version number in
the event payload. This will reduce future toil when updating the
sentry-sdk.
  • Loading branch information
willkg committed Nov 4, 2022
1 parent f0de9cc commit 227ba99
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
8 changes: 6 additions & 2 deletions socorro/unittest/processor/test_processor_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def test_transform_unexpected_exception(self):
assert finished_func.call_count == 1


# NOTE(willkg): If this changes, we should update it and look for new things that should
# be scrubbed. Use ANY for things that change between tests like timestamps, source code
# data (line numbers, file names, post/pre_context), event ids, build ids, versions,
# etc.
TRANSFORM_GET_ERROR = {
"breadcrumbs": ANY,
"contexts": {
Expand Down Expand Up @@ -230,8 +234,8 @@ def test_transform_unexpected_exception(self):
"threading",
],
"name": "sentry.python",
"packages": [{"name": "pypi:sentry-sdk", "version": "1.9.10"}],
"version": "1.9.10",
"packages": [{"name": "pypi:sentry-sdk", "version": ANY}],
"version": ANY,
},
"server_name": "testhost",
"timestamp": ANY,
Expand Down
8 changes: 5 additions & 3 deletions socorro/unittest/processor/test_processor_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def set_up_sentry():


# NOTE(willkg): If this changes, we should update it and look for new things that should
# be scrubbed. Use ANY for things that change between tests.
# be scrubbed. Use ANY for things that change between tests like timestamps, source code
# data (line numbers, file names, post/pre_context), event ids, build ids, versions,
# etc.
RULE_ERROR_EVENT = {
"breadcrumbs": {"values": []},
"contexts": {
Expand Down Expand Up @@ -120,8 +122,8 @@ def set_up_sentry():
"threading",
],
"name": "sentry.python",
"packages": [{"name": "pypi:sentry-sdk", "version": "1.9.10"}],
"version": "1.9.10",
"packages": [{"name": "pypi:sentry-sdk", "version": ANY}],
"version": ANY,
},
"server_name": "test_processor",
"timestamp": ANY,
Expand Down
12 changes: 7 additions & 5 deletions webapp-django/crashstats/crashstats/tests/test_sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@


# NOTE(willkg): If this changes, we should update it and look for new things that should
# be scrubbed. Use ANY for things that change between tests.
# be scrubbed. Use ANY for things that change between tests like timestamps, source code
# data (line numbers, file names, post/pre_context), event ids, build ids, versions,
# etc.
BROKEN_EVENT = {
"breadcrumbs": ANY,
"contexts": {
Expand All @@ -29,7 +31,7 @@
},
"trace": {
"description": "sentry_sdk.integrations.django._got_request_exception",
"op": "django.signals",
"op": "event.django",
"parent_span_id": ANY,
"span_id": ANY,
"trace_id": ANY,
Expand Down Expand Up @@ -114,9 +116,9 @@
"stdlib",
"threading",
],
"name": "sentry.python",
"packages": [{"name": "pypi:sentry-sdk", "version": "1.9.10"}],
"version": "1.9.10",
"name": "sentry.python.django",
"packages": [{"name": "pypi:sentry-sdk", "version": ANY}],
"version": ANY,
},
"server_name": ANY,
"timestamp": ANY,
Expand Down

0 comments on commit 227ba99

Please sign in to comment.