Skip to content

Workaround issue with Verify on Windows in Rider on .NET 7#2176

Merged
mattjohnsonpint merged 1 commit into
mainfrom
fix/verify
Feb 11, 2023
Merged

Workaround issue with Verify on Windows in Rider on .NET 7#2176
mattjohnsonpint merged 1 commit into
mainfrom
fix/verify

Conversation

@mattjohnsonpint

@mattjohnsonpint mattjohnsonpint commented Feb 11, 2023

Copy link
Copy Markdown
Contributor

Two Verify tests are failing, only on Windows, only on Rider, and only for .NET 7.

image

Received: SentryStackTraceFactoryTests.MethodGeneric_mode=Enhanced.DotNet7_0.received.txt
Verified: SentryStackTraceFactoryTests.MethodGeneric_mode=Enhanced.verified.txt
Compare Result:
  {
    FileName: Internals/SentryStackTraceFactoryTests.cs,
    Function: void SentryStackTraceFactoryTests.GenericMethodThatThrows<T>(T value),
-   AbsolutePath: {ProjectDirectory}Internals/SentryStackTraceFactoryTests.cs,
+   AbsolutePath: {UserProfile}/Code/getsentry/sentry-dotnet/test/Sentry.Tests/Internals/SentryStackTraceFactoryTests.cs,
    InApp: true,
    AddressMode: rel:0
  }

On closer inspection, it appears that the ProjectDir and SolutionDir MSBuild properties are being passed with a lower-case drive letter c:\ instead of C:\. These get written to assembly metadata attributes, and then fails the replacement that Verify does when scrubbing.

Will add an issue to Verify for @SimonCropp to investigate, but for now I'm working around it by forcing the drive letter to be upper-cased.

@SeanFeldman - This will fix the test fail you had while onboarding.

#skip-changelog

@SeanFeldman SeanFeldman 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.

I was supposed to reduce the load on Matt, not add it 😂

@mattjohnsonpint mattjohnsonpint merged commit 20de3b0 into main Feb 11, 2023
@mattjohnsonpint mattjohnsonpint deleted the fix/verify branch February 11, 2023 02:41
@SimonCropp

Copy link
Copy Markdown
Contributor

sorry for the hassle peoples. it is weird though, the tests target net7 and i run rider and have not seen this. can u provide a minimal repro?

@mattjohnsonpint

mattjohnsonpint commented Feb 11, 2023

Copy link
Copy Markdown
Contributor Author

@SimonCropp - If I can make a minimal repro, I'll open an issue on Verify. Playing a bit more with it, I don't think it's a Rider bug necessarily, but it manifests if you clone the sentry-dotnet repo clean (or git clean -dfx to clean an existing clone), comment out the workaround, then dotnet build SentryCore.slnf - the Sentry.Tests.dll assembly that gets built has the lower-cased drive letter. Then open SentryCore.slnf in Rider and run tests, and those two will fail.

Tried various things already to reproduce minimally, and I never get the lower-cased drive letter.

(Using Rider's "Assembly Explorer" to check the metadata on the assembly is pretty neat, BTW)

@mattjohnsonpint

Copy link
Copy Markdown
Contributor Author

But honestly, the workaround took about 10 minutes tops, so not sure how much time I want to invest here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants