|
@@ -1591,3 +1591,101 @@ class BasicResolvingIntegrationTest(RelayStoreHelper, TransactionTestCase):
|
|
|
]
|
|
|
|
|
|
assert received == expected
|
|
|
+
|
|
|
+ def test_is_jvm_event(self):
|
|
|
+ from sentry.lang.java.utils import is_jvm_event
|
|
|
+ from sentry.stacktraces.processing import find_stacktraces_in_data
|
|
|
+
|
|
|
+ event = {
|
|
|
+ "user": {"ip_address": "31.172.207.97"},
|
|
|
+ "extra": {},
|
|
|
+ "project": self.project.id,
|
|
|
+ "platform": "java",
|
|
|
+ "debug_meta": {"images": [{"type": "jvm", "debug_id": PROGUARD_INLINE_UUID}]},
|
|
|
+ "exception": {
|
|
|
+ "values": [
|
|
|
+ {
|
|
|
+ "stacktrace": {
|
|
|
+ "frames": [
|
|
|
+ {
|
|
|
+ "function": "whoops4",
|
|
|
+ "abs_path": "SourceFile",
|
|
|
+ "module": "io.sentry.samples.MainActivity$OneMoreInnerClass",
|
|
|
+ "filename": "SourceFile",
|
|
|
+ "lineno": 38,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "module": "io.sentry.samples",
|
|
|
+ "type": "RuntimeException",
|
|
|
+ "value": "whoops",
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "timestamp": iso_format(before_now(seconds=1)),
|
|
|
+ }
|
|
|
+ stacktraces = find_stacktraces_in_data(event)
|
|
|
+ assert is_jvm_event(event, stacktraces)
|
|
|
+
|
|
|
+ event = {
|
|
|
+ "user": {"ip_address": "31.172.207.97"},
|
|
|
+ "extra": {},
|
|
|
+ "project": self.project.id,
|
|
|
+ "debug_meta": {"images": [{"type": "jvm", "debug_id": PROGUARD_INLINE_UUID}]},
|
|
|
+ "exception": {
|
|
|
+ "values": [
|
|
|
+ {
|
|
|
+ "stacktrace": {
|
|
|
+ "frames": [
|
|
|
+ {
|
|
|
+ "function": "whoops4",
|
|
|
+ "abs_path": "SourceFile",
|
|
|
+ "module": "io.sentry.samples.MainActivity$OneMoreInnerClass",
|
|
|
+ "filename": "SourceFile",
|
|
|
+ "lineno": 38,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "module": "io.sentry.samples",
|
|
|
+ "type": "RuntimeException",
|
|
|
+ "value": "whoops",
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "timestamp": iso_format(before_now(seconds=1)),
|
|
|
+ }
|
|
|
+ stacktraces = find_stacktraces_in_data(event)
|
|
|
+ # has no platform
|
|
|
+ assert not is_jvm_event(event, stacktraces)
|
|
|
+
|
|
|
+ event = {
|
|
|
+ "user": {"ip_address": "31.172.207.97"},
|
|
|
+ "extra": {},
|
|
|
+ "project": self.project.id,
|
|
|
+ "platform": "java",
|
|
|
+ "debug_meta": {},
|
|
|
+ "exception": {
|
|
|
+ "values": [
|
|
|
+ {
|
|
|
+ "stacktrace": {
|
|
|
+ "frames": [
|
|
|
+ {
|
|
|
+ "function": "whoops4",
|
|
|
+ "abs_path": "SourceFile",
|
|
|
+ "module": "io.sentry.samples.MainActivity$OneMoreInnerClass",
|
|
|
+ "filename": "SourceFile",
|
|
|
+ "lineno": 38,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "module": "io.sentry.samples",
|
|
|
+ "type": "RuntimeException",
|
|
|
+ "value": "whoops",
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "timestamp": iso_format(before_now(seconds=1)),
|
|
|
+ }
|
|
|
+ stacktraces = find_stacktraces_in_data(event)
|
|
|
+ # has no modules
|
|
|
+ assert not is_jvm_event(event, stacktraces)
|