-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: Add support for connected component analysis #16770
Tests: Add support for connected component analysis #16770
Conversation
Hey there @dotMorten! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Ooooooh! |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run MAUI-DeviceTests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
BorderAndStrokeIsCorrectSize() is failing on Android API 30 and 23: Assert.Equal() Failure: Values are not within tolerance 2\nExpected: 180\nActual: 189.95238095238093 Issue15330() is failing on iOS: Assert.Equal() Failure: Values are not within tolerance 2\nExpected: 166.66666666666666\nActual: 152.66666666666666 |
@jstedfast Yup first one those failures are as reported: Android's border is half the thickness it needs to be. For the second one, not quite sure - I see it passing on iOS, and unfortunately with xunit you can't attach which assert it is failing to the assert failures like mstest can. |
Yea, it's something I find very frustrating about xunit as well. |
@jstedfast It's a "tenant" of xunit. I don't quite get it either. However you could just reference |
I assume the license headers are added intentionally? I personally don't have a problem with that, but I want to make sure that this is something that wouldn't cause any issues in agreement with the CLA and such. Do you know of any other places where this happens? I have seen some examples but those are mostly from people working at Xamarin (or variations of) and I guess that is a bit of a different situation. |
@jfversluis FWIW, @BretJohnson @mattleibow and I suggested he do that as one way we could give him attribution for this code. |
@jstedfast I'm all good with that! Just want to make sure that it won't cause any issues. Anyway we can know that? Or we might run that by? |
Here's our policy on licensing ...
Also described at https://github.com/dotnet/runtime/blob/main/docs/project/copyright.md Couple observations:
|
@richlander thanks Rich. Code is based on this: https://github.com/dotMorten/UniversalWPF/blob/main/src/UnitTests/Framework/ImageAnalysis.cs |
Yes. We'd be honored to have an entry from your repo. Please follow the pattern used at dotnet/runtime for third party notices for tests. Just do file search for "THIRD-PARTY" and you'll see all the test-specific TPNs. The whole idea is that the root TPN describes the license burden for product code. Tests don't contribute to that. However, it still important to record the third party contributions for tests. Our test code might contribute to someone else's product. OSS is a gift of sorts. A tidy (licensing) house enables unwrapping that gift w/confidence. Related: dotnet/runtime#89305 |
Thanks @richlander for the clear and specific guidance here. |
This is really a Grid test
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Am confused, did this PR merge in a bunch of unused code? Is anything using ConnectedComponentAnalysis? |
@riverar The tests are currently failing - they'll be turned on as those bugs gets fixed. |
@dotMorten Thanks for the clarification. I'm a bit skeptical of the value/hygiene of merging in a bunch of unused code, and announcing this from the mountain tops as some sort of success, but will try to remain optimistic here. |
This is an enabler, which we'll start to use for some tests. We were eager to get it merged so we can start to use it. Thanks again to @dotMorten for making this happen. |
Description of Change
This introduces the ability to analyze pixels as a set of connected pixels, allowing you to measure the size and location of UI elements, independent of device, screen size and DPI.
It will help ensure consistent layout across all supported .NET MAUI platforms.
A quick introduction to the algorithm used can be found here: https://www.youtube.com/watch?v=ticZclUYy88
Issues Fixed
While this specific issue doesn't actually fix any issue, the two included example tests does verify regressions and fixes.
The border test specifically is currently failing on Windows due to #16667 and on Android it finds the border to be too thin (it was made to validate #15339 and shows the result is closer to correct, but still needs tweak -cc @jstedfast ).
This is the initial PR submitted, as discussed in a recent meeting with @BretJohnson @PureWeen @mattleibow and @jstedfast
Please let me know what you'd like to change/improve/remove and I'd be more than happy to work with you on getting it to a point where you can start using it.
A few things that could be improved:
Fails on Windows due to #16667:
Fails on Android because border is too thin:
iOS passed (but second would fail if we could expand the view to the full screen, since safe area affects outcome):