Skip to content

Conversation

@fzyzcjy
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 flutter/packages/flutter repository. See also f: labels. label Mar 30, 2022
@fzyzcjy
Copy link
Contributor Author

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 March 30, 2022 10:49
@fzyzcjy fzyzcjy marked this pull request as ready for review April 4, 2022 23:39
@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
Contributor Author

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
Contributor Author

fzyzcjy commented Apr 6, 2022

/cc @dnfield

@dnfield
Copy link
Contributor

dnfield commented Apr 6, 2022

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

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Apr 6, 2022

Thanks, I will do that.

@goderbauer
Copy link
Member

goderbauer commented Apr 13, 2022

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

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Apr 14, 2022

Sure. I forgot it

@flutter-dashboard
Copy link

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 Changes to golden files label Apr 14, 2022
@goderbauer
Copy link
Member

@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
Contributor Author

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

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
Contributor Author

fzyzcjy commented Apr 21, 2022

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

@goderbauer
Copy link
Member

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 dnfield and flar April 21, 2022 16:06
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

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

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

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
Contributor

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
Contributor Author

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
Contributor Author

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
Contributor

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
Contributor

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
Contributor Author

fzyzcjy commented Apr 22, 2022

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

@flar
Copy link
Contributor

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

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
Contributor Author

fzyzcjy commented Apr 23, 2022

Now seems better

@goderbauer goderbauer requested a review from flar April 27, 2022 21:50
Copy link
Contributor

@flar flar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

@darrenaustin
Copy link
Contributor

Where the goldens for this approved? It looks like this is breaking the build:

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8815144942697521329/+/u/run_test.dart_for_framework_tests_shard_and_subshard_widgets/test_stdout

The following _Exception was thrown while running async test code:
Exception: Skia Gold received an unapproved image in post-submit
testing. Golden file images in flutter/flutter are triaged
in pre-submit during code review for the given PR.

Visit https://flutter-gold.skia.org// to view and approve
the image(s), or revert the associated change. For more
information, visit the wiki:
https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter

Debug information for Gold:
stdout: Given image with hash 94028cfacbe41a55af47edcddeff6540 for test widgets.image_filter_erode
Untriaged or negative image:
https://flutter-gold.skia.org/detail?test=widgets.image_filter_erode&digest=94028cfacbe41a55af47edcddeff6540


stderr: Test: widgets.image_filter_erode FAIL

When the exception was thrown, this was the stack:
#0      SkiaGoldClient.imgtestAdd (package:flutter_goldens_client/skia_client.dart:216:7)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

Can we just approve the new goldens? If not I will need to revert this to get the tree green again.

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented May 4, 2022

I do not have permission to approve the goldens, but seems that @flar has said that the goldens are ok, and he may have permission to approve

@darrenaustin
Copy link
Contributor

It looks like it has been resolved and the tree is green again, so it's all good now.

@flar
Copy link
Contributor

flar commented May 4, 2022

I did approve the goldens, so I'm not sure what happened.

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

Labels

framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants