Skip to content

tests(derived_code_mappings): Do not create object in parametrization section #86188

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

Merged
merged 2 commits into from
Mar 3, 2025
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
6 changes: 2 additions & 4 deletions src/sentry/issues/auto_source_code_config/stacktraces.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ def get_stacktraces(data: NodeData | dict[str, Any]) -> list[dict[str, Any]]:
if exceptions:
return [e["stacktrace"] for e in exceptions if get_path(e, "stacktrace", "frames")]

stacktrace = data.get("stacktrace")
if stacktrace and stacktrace.get("frames"):
logger.warning("Investigate if we use this code path in production.")
return [stacktrace]
if "stacktrace" in data:
return [data["stacktrace"]]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unrelated change but I wanted to get it out.


return []
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,26 @@ def test_raises_no_extension(self) -> None:
"frame_filename, prefix",
[
pytest.param(
FrameInfo({"filename": "app:///utils/something.py"}),
"app:///utils/something.py",
"app:///utils",
),
pytest.param(
FrameInfo({"filename": "./app/utils/something.py"}),
"./app/utils/something.py",
"./app",
),
pytest.param(
FrameInfo({"filename": "../../../../../../packages/something.py"}),
"../../../../../../packages/something.py",
"../../../../../../packages",
),
pytest.param(
FrameInfo({"filename": "app:///../services/something.py"}),
"app:///../services/something.py",
"app:///../services",
),
],
)
def test_straight_path_prefix(self, frame_filename: FrameInfo, prefix: str) -> None:
assert frame_filename.stack_root == prefix
def test_straight_path_prefix(self, frame_filename: str, prefix: str) -> None:
frame_info = FrameInfo({"filename": frame_filename})
assert frame_info.stack_root == prefix


class TestDerivedCodeMappings(TestCase):
Expand Down
Loading