X Tutup
The Wayback Machine - https://web.archive.org/web/20220503231234/https://github.com/flutter/flutter/pull/101036
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

(Test-only) Add tests for new ImageFilter.dilate/ImageFilter.erode in flutter engine #101036

Merged
merged 9 commits into from May 3, 2022

Conversation

Copy link
Contributor

@fzyzcjy fzyzcjy commented Mar 30, 2022

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
Please see #100830

List which issues are fixed by this PR. You must list at least one issue.
#100830

Related: flutter/engine#32334

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the framework label Mar 30, 2022
@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Mar 30, 2022

This should fail until flutter/engine#32334 is merged and flutter/flutter repo uses the latest flutter/engine.

@fzyzcjy fzyzcjy marked this pull request as draft Mar 30, 2022
@fzyzcjy fzyzcjy marked this pull request as ready for review Apr 4, 2022
@fzyzcjy fzyzcjy changed the title Add tests for new ImageFilter.dilate/ImageFilter.erode in flutter engine (Test-onlyu) Add tests for new ImageFilter.dilate/ImageFilter.erode in flutter engine Apr 6, 2022
@fzyzcjy fzyzcjy changed the title (Test-onlyu) Add tests for new ImageFilter.dilate/ImageFilter.erode in flutter engine (Test-only) Add tests for new ImageFilter.dilate/ImageFilter.erode in flutter engine Apr 6, 2022
@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 6, 2022

We know dilate/erode is not implemented for the web platform, just like the compose filter. So what should I do (skip tests when in web?)?

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following UnimplementedError was thrown running a test:
ImageFilter.dilate not implemented for web platform.

When the exception was thrown, this was the stack:
../dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49  throw_
../lib/ui/painting.dart 411:5                                                    dilate
image_filter_test.dart.js 428:133                                                <fn>
../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54            runBody
../dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 123:5            _async
image_filter_test.dart.js 427:80                                                 <fn>
../packages/flutter_test/src/matchers.dart.js 4522:19                            <fn>

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 6, 2022

/cc @dnfield

@dnfield
Copy link

@dnfield dnfield commented Apr 6, 2022

Skip these on web with a reference to the bug filed to implement them for web.

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 6, 2022

Thanks, I will do that.

@goderbauer
Copy link

@goderbauer goderbauer commented Apr 13, 2022

@fzyzcjy Can you update the tests per the suggestion above to make the checks happy?

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 14, 2022

Sure. I forgot it

@flutter-dashboard
Copy link

@flutter-dashboard flutter-dashboard bot commented Apr 14, 2022

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #101036 at sha c39d7b8

@flutter-dashboard flutter-dashboard bot added the will affect goldens label Apr 14, 2022
@goderbauer
Copy link

@goderbauer goderbauer commented Apr 20, 2022

@fzyzcjy Can you take a look at the golden images linked in the previous comment to confirm that that's what you expected them to look like? One of the images looks empty, which seems odd...

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 21, 2022

@goderbauer I guess it is right, just b/c it erodes too much. I have updated the test so it will be less strange.

@flutter-dashboard
Copy link

@flutter-dashboard flutter-dashboard bot commented Apr 21, 2022

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #101036 at sha e3d3659

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 21, 2022

The gold looks better. (Notice it has very very thin lines)

@goderbauer
Copy link

@goderbauer goderbauer commented Apr 21, 2022

Thanks, @fzyzcjy

@dnfield or @flar could you review this one (and also approve the goldens) since you reviewed the upstream PR in the engine?

@goderbauer goderbauer requested review from flar and dnfield Apr 21, 2022
child: ImageFiltered(
// Do not erode too much, otherwise we will see nothing left.
imageFilter: ImageFilter.erode(radiusX: 1.0, radiusY: 1.0),
child: const Placeholder(),
Copy link
Contributor

@flar flar Apr 21, 2022

Choose a reason for hiding this comment

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

The place holder by default draws a box with diagonals with a stroke width of 2 and doesn't survive the erode process. Try increasing the stroke width on both to a reasonable size so it doesn't erode completely for the golden image.

Copy link
Contributor

@flar flar Apr 21, 2022

Choose a reason for hiding this comment

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

Actually, the dilate filter shows up fine in its golden, it's definitely more than 2 pixels wide, but the erode filter creates a blank image.

Copy link
Contributor Author

@fzyzcjy fzyzcjy Apr 22, 2022

Choose a reason for hiding this comment

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

stroke width modified.

@flar
Copy link

@flar flar commented Apr 22, 2022

Thanks, @fzyzcjy

@dnfield or @flar could you review this one (and also approve the goldens) since you reviewed the upstream PR in the engine?

I still don't see anything rendered in the erode test even if I click on it to see it full size. Am I clicking on the wrong link?

Actually, it looks like I was reviewing the goldens from before I requested a larger stroke width. Maybe they haven't been updated yet?

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 22, 2022

I still don't see anything rendered in the erode test even if I click on it to see it full size. Am I clicking on the wrong link?
Actually, it looks like I was reviewing the goldens from before I requested a larger stroke width. Maybe they haven't been updated yet?

I guess the CI is even not executed after modifying strokewidth...

image

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 22, 2022

I guess the failure (and seems skipped executing all tests related to golden) is not caused by me. So maybe need to wait

@flar
Copy link

@flar flar commented Apr 22, 2022

I guess the failure (and seems skipped executing all tests related to golden) is not caused by me. So maybe need to wait

I mentioned it on the infra Discord chat to see if someone can poke it.

@flar
Copy link

@flar flar commented Apr 22, 2022

I would just LGTM to let it merge, but I'm worried it may merge with bad goldens and cause problems down the line.

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 22, 2022

Take your time. Since this is a test-only PR I am not that urgent :)

@flar
Copy link

@flar flar commented Apr 22, 2022

It looks like you need to rebase in order to get the ci.yaml to gel with the latest CI recipes and then hopefully final goldens will be generated.

@flutter-dashboard
Copy link

@flutter-dashboard flutter-dashboard bot commented Apr 23, 2022

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #101036 at sha 692b271

@fzyzcjy
Copy link
Author

@fzyzcjy fzyzcjy commented Apr 23, 2022

Now seems better

@goderbauer goderbauer requested a review from flar Apr 27, 2022
flar
flar approved these changes May 3, 2022
Copy link
Contributor

@flar flar left a comment

LGTM

Copy link
Member

@goderbauer goderbauer left a comment

LGTM

@goderbauer goderbauer added the waiting for tree to go green label May 3, 2022
@fluttergithubbot fluttergithubbot merged commit 896e5b3 into flutter:master May 3, 2022
63 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this issue May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework waiting for tree to go green will affect goldens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants
X Tutup