Skip to content

test: scrub stack frame line numbers from Verify snapshots - #6088

Merged
ric-oliv merged 3 commits into
mainfrom
ai/sentry-dotnet-6085-f8fcba
Dec 3, 2026
Merged

ric-oliv merged 3 commits into
mainfrom
ai/sentry-dotnet-6085-f8fcba

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

Snapshots that capture stack traces recorded each frame's LineNumber and ColumnNumber, so any edit above the call site in the test file churned them (#6084 hit this with a #pragma).

The shared StackFrameConverter in test/Sentry.Testing/VerifyExtensions.cs now normalises both to 1 when present, the same way it already handles FunctionId and InstructionAddress. Snapshots still record that a line number was captured, just not which one. Mono still records null, unchanged.

The Net4_8 snapshots are Windows-only, so they were edited by hand to match.

Closes #6085

#skip-changelog

🤖 Generated with Claude Code

Edits above a call site in a test file shifted the recorded LineNumber and
churned the snapshot with no change in behaviour. The stack frame converter
now normalises LineNumber and ColumnNumber to a sentinel when present, as it
already does for FunctionId and InstructionAddress.

Fixes #6085

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: low

For commit 492fba0.

This label is a hint for reviewers, not an approval.

@sentry-junior sentry-junior Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good to approve, with optional comments

Test-only change that fixes the cause in #6085: StackFrameConverter writes LineNumber/ColumnNumber as _ when present and keeps null when absent, so snapshots no longer churn on unrelated edits. The new commit deletes the Serilog Simple Net4_8/Mono4_0 snapshots, which is safe because test/Sentry.Serilog.Tests/IntegrationTests.verify.cs is wrapped in #if NET6_0_OR_GREATER, so no .NET Framework or Mono test could ever match them.

  • Optional: the PR description is now stale. It says the values are normalised to 1 and that the Net4_8 snapshots were hand-edited, but they are written as _ and the Serilog Net4_8 snapshot was deleted. Worth updating, since the description may end up in the squash commit.
  • Optional: test/Sentry.NLog.Tests/IntegrationTests.Simple.Net4_8.verified.txt is still hand-edited and only runs on Windows, so confirm the Windows test job passes on this head before merging.

This is an automated preliminary review.

Comment thread test/Sentry.Testing/VerifyExtensions.cs Resolved
A sentinel of 1 read like a real line number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 3, 2026
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.52%. Comparing base (0967ff3) to head (492fba0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6088   +/-   ##
=======================================
  Coverage   78.51%   78.52%           
=======================================
  Files         539      539           
  Lines       20194    20194           
  Branches     4062     4062           
=======================================
+ Hits        15856    15857    +1     
+ Misses       3492     3491    -1     
  Partials      846      846           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review December 3, 2026 03:56
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: medium PR risk score: medium labels Dec 3, 2026

@ric-oliv ric-oliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good!

IntegrationTests.verify.cs is compiled only for NET6_0_OR_GREATER, so these
snapshots were never checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Dec 3, 2026

@ric-oliv ric-oliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@ric-oliv
ric-oliv merged commit 63363ec into main Dec 3, 2026
55 checks passed
@ric-oliv
ric-oliv deleted the ai/sentry-dotnet-6085-f8fcba branch December 3, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: scrub stack frame line numbers from Verify snapshots

2 participants