-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[tests] Analyzer / code fix provider for UITest [Test] without [Category] #23287
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PureWeen
added
the
area-infrastructure
CI, Maestro / Coherency, upstream dependencies/versions
label
Jun 27, 2024
mattleibow
reviewed
Jun 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Not sure if you also need to add it to the main Microsft.Maui.sln. This may also need to be added to the vscode sln - basically any sln or slnf that has the UI tests.
src/TestUtils/src/UITest.Analyzers/NUnit/NUnitTestMissingCategoryClassCodeFixProvider.cs
Show resolved
Hide resolved
src/TestUtils/src/UITest.Analyzers/NUnit/NUnitTestMissingCategoryMethodCodeFixProvider.cs
Show resolved
Hide resolved
Note to self: the categories added in this PR need to be added to #22609 |
mattleibow
previously approved these changes
Jul 3, 2024
First case is for finding NUnit [Test] marked methods that do not also have a [Category] on the method or parent class.
jfversluis
force-pushed
the
dev/redth/uitest-analyzers
branch
from
July 4, 2024 06:45
f51e276
to
2f9c875
Compare
mattleibow
approved these changes
Jul 4, 2024
This was referenced Jul 4, 2024
samhouts
added
the
fixed-in-net9.0-nightly
This may be available in a nightly release!
label
Aug 2, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-infrastructure
CI, Maestro / Coherency, upstream dependencies/versions
area-testing
Unit tests, device tests
fixed-in-8.0.70
fixed-in-net9.0-nightly
This may be available in a nightly release!
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
We want to ensure that all of our NUnit UITests have a [Category] attribute assigned to them either at the method level or class level. This is a simple analyzer and code fix provider to ensure this happens in the relevant projects.
The goal is not to ship this anywhere, but to consume from the repo ourselves.
The project reference has a few notable properties to reference it directly:
We can add more analyzers later as needed, and we can reuse this pattern in another project in the future for other types of analyzers that we may want to eventually ship with .NET MAUI itself.