Skip to content
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

Fix test target framework issues #1958

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

PathogenDavid
Copy link
Member

@PathogenDavid PathogenDavid commented Aug 7, 2024

This fixes a mistake made in #1952

  • Bonsai.Editor.Tests now targets net8.0-windows as appropriate
  • Made the relevant NuGet warning into an error to avoid this mistake in the future
  • Disabled running net8.0-windows tests on Linux

The last one was somewhat annoying as dotnet test doesn't have a great way to just run tests for all target frameworks except one or something similar. In the end I opted to run net472, net8.0, and net8.0-windows all as discrete steps (which will actually be kinda nice anyway.)

As a result, test projects are only allowed to target one of those three target frameworks. This is enforced by the build system in order to avoid the easy mistake of having an entire test suite skipped without knowing.


I also looked into why GitHub Actions didn't highlight these warnings in the workflow summary. Turns out it actually did highlight them, so we're just bad and both missed it. The warnings just didn't show up on the PR because they aren't associated with any particular file within the PR.

It might be nice if warnings like that ended up on the PR anyway. Not sure if there's an easy way to do that unfortunately. Easiest solution is probably that we just get in the habit of reviewing the workflow run as part of code reviews.

As an aside though, I did find out more about how this GitHub Actions feature works. They're called problem matchers and are documented here. They can be customized, and it turns out setup-dotnet and such tend to add their own relevant patterns.

Relates to #1948

Also made this NuGet warning associated with this mistake into an error.

Relates to bonsai-rx#1948 and bonsai-rx#1952
This also enforces which target frameworks are permitted for test projects to avoid mistakes that would cause tests to be silently skipped on CI.
@PathogenDavid PathogenDavid added this to the 2.9 milestone Aug 7, 2024
@PathogenDavid PathogenDavid requested a review from glopesdev August 7, 2024 02:39
Copy link
Member

@glopesdev glopesdev left a comment

Choose a reason for hiding this comment

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

Looks great, I didn't know about problem matchers, will have to dig a bit more into it. Would be nice if there was a way to always surface any restore/build warnings to the UI no matter what they are. Catching particular errors is also a good way to go for now.

As a result, test projects are only allowed to target one of those three target frameworks. This is enforced by the build system in order to avoid the easy mistake of having an entire test suite skipped without knowing.

This is also a good idea, I can definitely imagine this happening when some new .NET comes along, but it's not a bad compromise either.

@glopesdev glopesdev added the fix Pull request that fixes an issue label Aug 7, 2024
@glopesdev glopesdev merged commit 5f8e06e into bonsai-rx:main Aug 7, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull request that fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants