-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update OutlinedButton tests for Material 3
#136809
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
Update OutlinedButton tests for Material 3
#136809
Conversation
aff745c to
250fefe
Compare
|
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 Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #136809 at sha 250fefeaa7c41e6ff7be9a732c46f591c51b27c2 |
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.
For M3, swapped mock canvas check with golden test as suggested by @Piinks
250fefe to
cf2a985
Compare
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. Changes reported for pull request #136809 at sha cf2a985e7f774bcef919459109d836d7caa6fab0 |
QuncCccccc
left a comment
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.
Thanks for the contribution! LGTM. Just left a question and some nits:)
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.
Just a question. Why do we use this tag here? Not sure the usage of this tag:)
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.
This is required for test class with golden tests.
https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package%3Aflutter#reduced-test-set-tag
Since M3 Ink well shader can't be tested from mock canvas. We discussed and agreed to swap it for a golden test.
#136809 (comment)
cf2a985 to
0d47fd9
Compare
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
) This reverts commit d36a843 (#136809) This fails even tho golden files were approved and `golden test` pending was cleared and green and `autosubmit` successfully merged the PR. ```console 02:42 +4618 ~5: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ The following SkiaException was thrown while running async test code: 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 37275e74c51f98d7abd7f301c5c94ac1 for test material.outlined_button.ink_sparkle.default Expectation for test: 531f5fa74908d2e6db2b8fd86a6b8662 (positive) Expectation for test: 683e368ff51d947a3d63c2a5f4568cf6 (positive) Expectation for test: 749241ff0fa21595b2c6cb551fd40b68 (positive) Expectation for test: aaf9ac1328614d6c9f4540308bc86f62 (positive) Expectation for test: b31a50440c7dd31b10cacd9e7b5c6b86 (positive) Expectation for test: c0a7c8c625b69ddc695a770f28abd403 (positive) Expectation for test: f1f66ce931c2ef33ebcb699a637025a6 (positive) Expectation for test: 2d32e34efc1d7ca4cd12965402fb76ff (positive) Untriaged or negative image: https://flutter-gold.skia.org/detail?grouping=name%3Dmaterial.outlined_button.ink_sparkle.default%26source_type%3Dflutter&digest=37275e74c51f98d7abd7f301c5c94ac1 stderr: Test: material.outlined_button.ink_sparkle.default FAIL result-state.json: No result file found. When the exception was thrown, this was the stack: #0 SkiaGoldClient.imgtestAdd (package:flutter_goldens_client/skia_client.dart:243:7) <asynchronous suspension> #1 MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32) <asynchronous suspension> <asynchronous suspension> (elided one frame from dart:async) The exception was caught asynchronously. ════════════════════════════════════════════════════════════════════════════════════════════════════ 02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works 02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults [E] Test failed. See exception logs above. The test description was: Material3 - OutlinedButton, OutlinedButton.icon defaults 02:42 +4619 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works ``` ## 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]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
Roll Flutter from 5e8b5f4 to 5dd2a4e (59 revisions) flutter/flutter@5e8b5f4...5dd2a4e 2023-10-25 [email protected] Ensure Xcode project is setup to start debugger (flutter/flutter#136977) 2023-10-25 [email protected] Marks Windows build_tests_6_6 to be unflaky (flutter/flutter#137216) 2023-10-25 [email protected] Remove gem and docker files. (flutter/flutter#137200) 2023-10-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[gallery] Reland roll gallery to ecfb9e5352bd12032301b12b30d5853d83d89bda" (flutter/flutter#137264) 2023-10-25 [email protected] [gallery] Reland roll gallery to ecfb9e5352bd12032301b12b30d5853d83d89bda (flutter/flutter#137199) 2023-10-25 [email protected] Roll Packages from 2faf992 to f751ffb (11 revisions) (flutter/flutter#137254) 2023-10-25 [email protected] Marks Windows build_tests_3_6 to be unflaky (flutter/flutter#137214) 2023-10-25 [email protected] Marks Windows build_tests_5_6 to be unflaky (flutter/flutter#137215) 2023-10-25 [email protected] Marks Windows build_tests_2_6 to be unflaky (flutter/flutter#137213) 2023-10-25 [email protected] Revert "Update `OutlinedButton` tests for Material 3 (#136809)" (flutter/flutter#137242) 2023-10-25 [email protected] Update `OutlinedButton` tests for Material 3 (flutter/flutter#136809) 2023-10-25 [email protected] Let `OverflowBox` be shrink-wrappable (flutter/flutter#129095) 2023-10-25 [email protected] Add dependency on leak_tracker to flutter_test. (flutter/flutter#137069) 2023-10-25 [email protected] fix SliverReorderableLists item wrong offset (flutter/flutter#136828) 2023-10-25 [email protected] Remove `bringup: true` from realm_checker and remove the redundant tool test. (flutter/flutter#137186) 2023-10-25 [email protected] Revert "Fix Gradle lockfiles." (flutter/flutter#137198) 2023-10-24 [email protected] Fix Gradle lockfiles. (flutter/flutter#137190) 2023-10-24 [email protected] Fix Typos (flutter/flutter#137173) 2023-10-24 [email protected] Roll Flutter Engine from d6a48e9963df to 6e09ee14e244 (1 revision) (flutter/flutter#137185) 2023-10-24 [email protected] Roll Flutter Engine from 602b5131ee4d to d6a48e9963df (6 revisions) (flutter/flutter#137180) 2023-10-24 [email protected] TextField - allow to customize cursor color in error state (flutter/flutter#136121) 2023-10-24 [email protected] [macOS] Refactor macOS build/codesize analysis (flutter/flutter#137164) 2023-10-24 [email protected] Roll Flutter Engine from dc00de7dacf4 to 602b5131ee4d (1 revision) (flutter/flutter#137174) 2023-10-24 [email protected] Check the realm file in its own shard. (flutter/flutter#137160) 2023-10-24 [email protected] Roll Flutter Engine from 1890bd7dc412 to dc00de7dacf4 (1 revision) (flutter/flutter#137172) 2023-10-24 [email protected] Roll Flutter Engine from ca7ef01c99c6 to 1890bd7dc412 (2 revisions) (flutter/flutter#137158) 2023-10-24 [email protected] Migrate mac builds to ruby dep. (flutter/flutter#136929) 2023-10-24 [email protected] Roll Packages from 4bf5114 to 2faf992 (7 revisions) (flutter/flutter#137154) 2023-10-24 [email protected] Roll Flutter Engine from 7224835bb65f to ca7ef01c99c6 (1 revision) (flutter/flutter#137153) 2023-10-24 [email protected] fix some typos (flutter/flutter#137144) 2023-10-24 [email protected] Roll Flutter Engine from 8f7488e0b4b5 to 7224835bb65f (1 revision) (flutter/flutter#137150) 2023-10-24 [email protected] Roll Flutter Engine from d58895093d0a to 8f7488e0b4b5 (3 revisions) (flutter/flutter#137135) 2023-10-24 [email protected] Roll Flutter Engine from 2a8471f188cd to d58895093d0a (4 revisions) (flutter/flutter#137130) 2023-10-24 [email protected] Roll Flutter Engine from 71600d89aa3f to 2a8471f188cd (2 revisions) (flutter/flutter#137129) 2023-10-24 [email protected] Roll Flutter Engine from 3dd197dcf9e5 to 71600d89aa3f (1 revision) (flutter/flutter#137127) 2023-10-24 [email protected] Roll Flutter Engine from bdbd1058858b to 3dd197dcf9e5 (2 revisions) (flutter/flutter#137125) 2023-10-24 [email protected] Roll Flutter Engine from 0ef5caa91c40 to bdbd1058858b (1 revision) (flutter/flutter#137119) 2023-10-24 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Use `coverage.collect`'s `coverableLineCache` param to speed up coverage" (flutter/flutter#137121) 2023-10-24 [email protected] Roll Flutter Engine from dd6a6531e816 to 0ef5caa91c40 (1 revision) (flutter/flutter#137114) 2023-10-24 [email protected] Roll Flutter Engine from 0bd703132cc1 to dd6a6531e816 (2 revisions) (flutter/flutter#137111) 2023-10-23 [email protected] Roll Flutter Engine from abeab897a29c to 0bd703132cc1 (3 revisions) (flutter/flutter#137107) 2023-10-23 [email protected] Upgrade packages in flutter and flutter_test. (flutter/flutter#137106) 2023-10-23 49699333+dependabot[bot]@users.noreply.github.com Bump ossf/scorecard-action from 2.2.0 to 2.3.1 (flutter/flutter#137103) 2023-10-23 [email protected] Dartdoc warnings (flutter/flutter#137077) 2023-10-23 [email protected] Roll Flutter Engine from e89f0421bcab to abeab897a29c (5 revisions) (flutter/flutter#137100) 2023-10-23 [email protected] Cover last test/material tests with leak tracking. (flutter/flutter#137004) ...
) This updates one of them M3 test to use golden test from #135901 Keeping it consistent with this [update](#136809 (comment))
… (#137247)" (#137406) …9) (#137247)" This reverts commit 008a10f. *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue.* *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]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
Updated unit tests for
CircleOutlinedButtonto have M2 and M3 versions.More info in #127064
This also gets rid of unnecessary
fromSwatchusage (part of #132584 documentation and test cleanup)Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.