Skip to content

test: scrub stack frame line numbers from Verify snapshots #6085

Done

Description

@jamescrosswell

Snapshot tests that capture stack traces record each frame's LineNumber, e.g. LineNumber: 54 in test/Sentry.Serilog.Tests/IntegrationTests.Simple.DotNet{8,9,10}_0.verified.txt. Any edit above the call site in the test file (a new using, a #pragma) shifts the number and churns the snapshot, with no change in behaviour. #6084 hit this: adding a file-level #pragma warning disable CS0618 moved the line 53 → 54 in three snapshots.

The .NET Framework and Mono snapshots already don't record line numbers, so the value isn't load-bearing.

Proposal

Scrub or ignore SentryStackFrame.LineNumber (and probably ColumnNumber) in the shared Verify settings in test/Sentry.Testing/VerifyExtensions.cs, next to the existing IgnoreMembers, then re-accept the affected snapshots with pwsh ./scripts/accept-verifier-changes.ps1.

If a test genuinely needs to check line numbers, it can assert on them directly rather than through a snapshot.

Activity

  1. linear-code commented on Dec 3, 2026

    @linear-code
  2. added
    .NET
    and removed on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETTests

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions