Skip to content

Commit

Permalink
rename get_stacktrace_string tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lobsterkatie committed Dec 19, 2024
1 parent 54cda25 commit bc2eb07
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/sentry/seer/similarity/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def test_chained(self):
)
assert stacktrace_str == expected_stacktrace_str

def test_chained_too_many_frames(self):
def test_chained_stacktrace_truncation(self):
data_chained_exception = copy.deepcopy(self.CHAINED_APP_DATA)
data_chained_exception["app"]["component"]["values"][0]["values"] = [
self.create_exception(
Expand Down Expand Up @@ -582,7 +582,7 @@ def test_chained_too_many_frames(self):
)
assert stacktrace_str == expected

def test_chained_too_many_frames_all_minified_js(self):
def test_chained_stacktrace_truncation_all_minified_js(self):
data_chained_exception = copy.deepcopy(self.CHAINED_APP_DATA)
data_chained_exception["app"]["component"]["values"][0]["values"] = [
self.create_exception(
Expand Down Expand Up @@ -634,7 +634,7 @@ def test_chained_too_many_frames_all_minified_js(self):
)
assert stacktrace_str == expected

def test_chained_too_many_frames_minified_js_frame_limit(self):
def test_chained_stacktrace_truncation_minified_js_frame_limit_is_lower(self):
"""Test that we restrict fully-minified stacktraces to 20 frames, and all other stacktraces to 30 frames."""
for minified_frames, expected_frame_count in [("all", 20), ("some", 30), ("none", 30)]:
data_chained_exception = copy.deepcopy(self.CHAINED_APP_DATA)
Expand Down Expand Up @@ -676,7 +676,7 @@ def test_chained_too_many_frames_minified_js_frame_limit(self):
== expected_frame_count
)

def test_chained_too_many_exceptions(self):
def test_chained_exception_limit(self):
"""Test that we restrict number of chained exceptions to MAX_FRAME_COUNT."""
data_chained_exception = copy.deepcopy(self.CHAINED_APP_DATA)
data_chained_exception["app"]["component"]["values"][0]["values"] = [
Expand Down Expand Up @@ -717,7 +717,7 @@ def test_no_app_no_system(self):
stacktrace_str = get_stacktrace_string(data)
assert stacktrace_str == ""

def test_too_many_system_frames_single_exception(self):
def test_stacktrace_length_filter_single_exception(self):
data_system = copy.deepcopy(self.BASE_APP_DATA)
data_system["system"] = data_system.pop("app")
data_system["system"]["component"]["values"][0]["values"][0][
Expand All @@ -727,7 +727,7 @@ def test_too_many_system_frames_single_exception(self):
with pytest.raises(TooManyOnlySystemFramesException):
get_stacktrace_string(data_system, platform="java")

def test_too_many_system_frames_single_exception_invalid_platform(self):
def test_stacktrace_length_filter_single_exception_invalid_platform(self):
data_system = copy.deepcopy(self.BASE_APP_DATA)
data_system["system"] = data_system.pop("app")
data_system["system"]["component"]["values"][0]["values"][0][
Expand All @@ -737,7 +737,7 @@ def test_too_many_system_frames_single_exception_invalid_platform(self):
stacktrace_string = get_stacktrace_string(data_system, "python")
assert stacktrace_string is not None and stacktrace_string != ""

def test_too_many_system_frames_chained_exception(self):
def test_stacktrace_length_filter_chained_exception(self):
data_system = copy.deepcopy(self.CHAINED_APP_DATA)
data_system["system"] = data_system.pop("app")
# Split MAX_FRAME_COUNT across the two exceptions
Expand All @@ -751,7 +751,7 @@ def test_too_many_system_frames_chained_exception(self):
with pytest.raises(TooManyOnlySystemFramesException):
get_stacktrace_string(data_system, platform="java")

def test_too_many_system_frames_chained_exception_invalid_platform(self):
def test_stacktrace_length_filter_chained_exception_invalid_platform(self):
data_system = copy.deepcopy(self.CHAINED_APP_DATA)
data_system["system"] = data_system.pop("app")
# Split MAX_FRAME_COUNT across the two exceptions
Expand All @@ -765,7 +765,7 @@ def test_too_many_system_frames_chained_exception_invalid_platform(self):
stacktrace_string = get_stacktrace_string(data_system, "python")
assert stacktrace_string is not None and stacktrace_string != ""

def test_too_many_in_app_contributing_frames(self):
def test_stacktrace_truncation_uses_in_app_contributing_frames(self):
"""
Check that when there are over MAX_FRAME_COUNT contributing frames, the last MAX_FRAME_COUNT
is included.
Expand Down Expand Up @@ -798,7 +798,7 @@ def test_too_many_in_app_contributing_frames(self):
assert ("test = " + str(i) + "!") in stacktrace_str
assert num_frames == MAX_FRAME_COUNT

def test_too_many_frames_minified_js_frame_limit(self):
def test_stacktrace_truncation_minified_js_frame_limit_is_lower(self):
"""Test that we restrict fully-minified stacktraces to 20 frames, and all other stacktraces to 30 frames."""
for minified_frames, expected_frame_count in [("all", 20), ("some", 30), ("none", 30)]:
data_frames = copy.deepcopy(self.BASE_APP_DATA)
Expand Down

0 comments on commit bc2eb07

Please sign in to comment.