VerifyTests / Verify

Verify is a snapshot tool that simplifies the assertion of complex data models and documents.
MIT License
2.51k stars 141 forks source link

`ScrubMachineName` seems to get mixed up with `ScrubUserName` #1319

Open bruno-garcia opened 1 week ago

bruno-garcia commented 1 week ago

Describe the bug

In the Sentry .NET SDK repo, I opened a PR to change the GHA runner from ubuntu-latest to ubuntu-latest-4-cores.

A verify test on the Serilog tests fails (but not the other Integration tests):

-             ServerName: TheMachineName,
+             ServerName: TheUserName,

THe ServerName Scrubber: https://github.com/getsentry/sentry-dotnet/blob/edd0be43dc5d11f81dea765fca6aafdbad37a6f1/test/Sentry.Testing/VerifyExtensions.cs#L12C14-L12C30

Seems like that got mixed with the scrubber for UserName:

https://github.com/VerifyTests/Verify/blob/752a4c27e876bdb4586c6d90cf36e509f833145b/src/Verify/Serialization/Scrubbers/Scrubbers.cs#L14

No code change was done (as the diff shows), only the GHA runner changed.

We call the ignore code here:

https://github.com/getsentry/sentry-dotnet/blob/edd0be43dc5d11f81dea765fca6aafdbad37a6f1/test/Sentry.Serilog.Tests/IntegrationTests.verify.cs#L61C14-L61C41

Minimal Repro

Diff

Submit a PR that fixes the bug

Sorry I dunno what might be going on. Any insight appreciated.

SimonCropp commented 1 week ago

thats a weird one. what do we get if the server and user name are not scrubbed?

bruno-garcia commented 1 week ago

thats a weird one. what do we get if the server and user name are not scrubbed?

Not sure. I see you made a PR , thank you! Do you still need an answer for this? If so I can look it up

bruno-garcia commented 1 week ago

Possibly related:

https://github.com/getsentry/sentry-unreal/pull/658#issuecomment-2418655134