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

Add example of goldenFileComparator usage in widget tests #150422

Conversation

alestiago
Copy link
Contributor

@alestiago alestiago commented Jun 18, 2024

As from #76337, precisely #76337 (comment) and #76337 (comment). There is missing documentation with an example on how the goldenFileComparator can be used.

This change updates the documentation by providing an additional code snippet to the example that was already stated by the documentation.

Follows the effort made by #76337 and #150343.

Pre-launch Checklist

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

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

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jun 18, 2024
@alestiago alestiago marked this pull request as draft June 18, 2024 12:10
@alestiago alestiago marked this pull request as ready for review June 18, 2024 12:15
@alestiago alestiago changed the title docs: add example of goldenFileComparator usage in widget tests Add example of goldenFileComparator usage in widget tests Jun 18, 2024
@goderbauer goderbauer requested a review from Piinks June 18, 2024 22:02
@Piinks Piinks force-pushed the alestiago/add-documentation-example-about-goldenFileComparator-usage branch from 8a153f9 to 794ca59 Compare June 25, 2024 17:10
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Hey @alestiago thanks for adding an example of this.

packages/flutter_test/lib/src/goldens.dart Outdated Show resolved Hide resolved
Co-authored-by: Kate Lovett <[email protected]>
@alestiago alestiago requested a review from Piinks June 26, 2024 09:22
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 28, 2024
@alestiago alestiago force-pushed the alestiago/add-documentation-example-about-goldenFileComparator-usage branch from 74c682c to cb97d8e Compare June 28, 2024 10:37
@github-actions github-actions bot removed the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 28, 2024
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

@QuncCccccc QuncCccccc left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution:)

To fix the linux analyzer, we might need to add some comments at top of the file to add some assumption for the example. Please see the suggested changes below. I think these changes can help fix the linux analyze test:)

packages/flutter_test/lib/src/goldens.dart Outdated Show resolved Hide resolved
packages/flutter_test/lib/src/goldens.dart Outdated Show resolved Hide resolved
packages/flutter_test/lib/src/goldens.dart Outdated Show resolved Hide resolved
@alestiago
Copy link
Contributor Author

@Piinks , @QuncCccccc thank you for the reviews! I've comitted the changes suggested by @QuncCccccc in 95156f9 and they have fixed the pipeline.

I'll let you all merge it in 🙌

@QuncCccccc QuncCccccc added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 3, 2024
@auto-submit auto-submit bot merged commit e383db7 into flutter:master Jul 3, 2024
71 checks passed
@alestiago alestiago deleted the alestiago/add-documentation-example-about-goldenFileComparator-usage branch July 4, 2024 09:41
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 7, 2024
Roll Flutter from af913a7 to fafd67d34d68 (41 revisions)

flutter/flutter@af913a7...fafd67d

2024-07-05 [email protected] Roll Flutter Engine from 74d40c160e48 to 4ee09d3b7f3b (1 revision) (flutter/flutter#151346)
2024-07-05 [email protected] Roll Flutter Engine from ba9c7b6336ef to 74d40c160e48 (1 revision) (flutter/flutter#151340)
2024-07-05 [email protected] Roll Flutter Engine from 1f0f950ea02a to ba9c7b6336ef (1 revision) (flutter/flutter#151331)
2024-07-05 [email protected] Roll Flutter Engine from 3c6a373bda3e to 1f0f950ea02a (1 revision) (flutter/flutter#151326)
2024-07-04 [email protected] Roll Flutter Engine from 79a91e38c587 to 3c6a373bda3e (2 revisions) (flutter/flutter#151318)
2024-07-04 [email protected] Roll Packages from d2705fb to 754de19 (3 revisions) (flutter/flutter#151315)
2024-07-04 [email protected] Roll Flutter Engine from 2b6bb516e7e6 to 79a91e38c587 (2 revisions) (flutter/flutter#151314)
2024-07-04 [email protected] Roll Flutter Engine from 8e2d05fa95d7 to 2b6bb516e7e6 (2 revisions) (flutter/flutter#151299)
2024-07-04 [email protected] Roll Flutter Engine from 4190543cb093 to 8e2d05fa95d7 (13 revisions) (flutter/flutter#151293)
2024-07-03 137456488 [email protected] Roll pub packages (flutter/flutter#151203)
2024-07-03 [email protected] Fix invalid URL suggestion for gradle incompatability (flutter/flutter#150999)
2024-07-03 423393 [email protected] Cupertino transparent navigation bars (flutter/flutter#149102)
2024-07-03 1961493 [email protected] Prepares semantics_update_test for upcoming link URL change (flutter/flutter#151261)
2024-07-03 [email protected] Add a message about spam/brigading (flutter/flutter#150583)
2024-07-03 [email protected] PinnedHeaderSliver example based on the iOS Settings AppBar (flutter/flutter#151205)
2024-07-03 [email protected] Update deprecation policy (flutter/flutter#151257)
2024-07-03 [email protected] SliverFloatingHeader (flutter/flutter#151145)
2024-07-03 34871572 [email protected] Remove warning when KGP version not detected (flutter/flutter#151254)
2024-07-03 34465683 [email protected] Feat: Add withOpacity to gradient (flutter/flutter#150670)
2024-07-03 [email protected] Fix references in examples (flutter/flutter#151204)
2024-07-03 82763757 [email protected] Fix link in tree hygene doc (flutter/flutter#151235)
2024-07-03 [email protected] content dimensions are not established get controller value error (flutter/flutter#148938)
2024-07-03 [email protected] chore: fix typos and link broken (flutter/flutter#150402)
2024-07-03 [email protected] Add example of goldenFileComparator usage in widget tests (flutter/flutter#150422)
2024-07-03 [email protected] Fix project name fallback (flutter/flutter#150614)
2024-07-03 [email protected] Roll Flutter Engine from a3e61c0fd1c2 to 4190543cb093 (1 revision) (flutter/flutter#151241)
2024-07-03 [email protected] Roll Flutter Engine from 8274f54f11be to a3e61c0fd1c2 (2 revisions) (flutter/flutter#151237)
2024-07-03 [email protected] Force regeneration of platform-specific manifests before running performance tests (flutter/flutter#151003)
2024-07-03 [email protected] Handle a SocketException thrown when sending the browser close command to Chrome (flutter/flutter#151197)
2024-07-03 [email protected] Roll Flutter Engine from a02e3f673da3 to 8274f54f11be (4 revisions) (flutter/flutter#151226)
2024-07-03 [email protected] Roll Flutter Engine from c5c0c54d6d1d to a02e3f673da3 (1 revision) (flutter/flutter#151212)
2024-07-03 [email protected] Roll Flutter Engine from 44278941443e to c5c0c54d6d1d (9 revisions) (flutter/flutter#151208)
2024-07-02 [email protected] Fix scheduler event loop being stuck due to task with Priority.idle (flutter/flutter#151168)
2024-07-02 [email protected] Fix result propagation in RenderSliverEdgeInsetsPadding.hitTestChildren (flutter/flutter#149825)
2024-07-02 [email protected] docImports for flutter_test (flutter/flutter#151189)
2024-07-02 [email protected] Interactable ScrollView content when settling a scroll activity (flutter/flutter#145848)
2024-07-02 [email protected] [flutter_tools] Update the mapping for the Dart SDK internal URI (flutter/flutter#151170)
2024-07-02 137456488 [email protected] Roll pub packages (flutter/flutter#151129)
2024-07-02 36861262 [email protected] Fix typo (flutter/flutter#151192)
2024-07-02 [email protected] [tool] Fix `stdin.flush` calls on processes started by `FakeProcessManager` (flutter/flutter#151183)
2024-07-02 [email protected] Roll Flutter Engine from 433d360eee11 to 44278941443e (4 revisions) (flutter/flutter#151186)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
...
TahaTesser pushed a commit to TahaTesser/flutter that referenced this pull request Jul 8, 2024
…0422)

As from flutter#76337, precisely flutter#76337 (comment) and flutter#76337 (comment). There is missing documentation with an example on how the [`goldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/goldenFileComparator.html) can be used.

This change updates the documentation by providing an additional code snippet to the example that was already stated by the documentation. 

Follows the effort made by flutter#76337 and flutter#150343.
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request Jul 8, 2024
…0422)

As from flutter#76337, precisely flutter#76337 (comment) and flutter#76337 (comment). There is missing documentation with an example on how the [`goldenFileComparator`](https://api.flutter.dev/flutter/flutter_test/goldenFileComparator.html) can be used.

This change updates the documentation by providing an additional code snippet to the example that was already stated by the documentation. 

Follows the effort made by flutter#76337 and flutter#150343.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants