-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[go_router] Activate leak testing #7546
[go_router] Activate leak testing #7546
Conversation
cc @polina-c |
I didn't modify the version number and the CHANGELOG, should I do it or is it not necessary for this? |
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.
I don't think you need to bump version in this case
@@ -22,6 +22,7 @@ dev_dependencies: | |||
flutter_test: | |||
sdk: flutter | |||
io: ^1.0.4 | |||
leak_tracker_flutter_testing: any |
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.
can you pin a version instead of any?
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.
Actually, the documentation recommends not to pin any number: see https://github.com/dart-lang/leak_tracker/blob/main/doc%2Fleak_tracking%2FDETECT.md
Do you still want me to pin one after reading this?
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.
oh i wasn't aware that is the guideline, thanks for pointing it out. LGTM
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.
It looks like the pipeline Linux repo_checks
is not happy with this. Should it be ignored (and how?) ?
Or is there something else we can do about it?
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.
I think we should ignore it given that is how leak tracking suggests.
I think you need to modify packages/script/configs/allowed_unpinned_deps.yaml
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.
I think you need to modify packages/script/configs/allowed_unpinned_deps.yaml
It looks like the tooling doesn't check for any
specifically, which it should, so that should work. (At some point I'll need to fix that and split this exception out into its own file, since in general we don't want to allow any
.)
FutureOr<void> testExecutable(FutureOr<void> Function() testMain) { | ||
LeakTesting.enable(); | ||
LeakTesting.settings = | ||
LeakTesting.settings.withIgnored(createdByTestHelpers: true); |
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.
any reason we are ignoring this?
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 what https://github.com/dart-lang/leak_tracker/blob/main/doc%2Fleak_tracking%2FDETECT.md suggests to do.
Maybe @polina-c would have more insights
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.
If test helpers create a disposable and then do not dispose it, it is not a big deal as it does not affect production code.
This setting helps to setup leak tracking faster for existing projects where test helpers are leaking.
But, it is up to each project if this should be set.
Does it help?
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.
Thank you @polina-c
@chunhtai test: Don't ignore leaks created by test helpers removes the ignore
Thanks for pushing it! |
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.
LGTM
@@ -22,6 +22,7 @@ dev_dependencies: | |||
flutter_test: | |||
sdk: flutter | |||
io: ^1.0.4 | |||
leak_tracker_flutter_testing: any |
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.
oh i wasn't aware that is the guideline, thanks for pointing it out. LGTM
override reason: test only. |
I am not sure what happen to the ci, can you try to rebase and see if that passes the ci. |
f4912f7
to
0e103fe
Compare
looks like the test was trying to run |
0e103fe
to
6595059
Compare
It looks like the signature needs to be Future<void> testExecutable(FutureOr<void> Function() testMain) @polina-c do you want me to make a PR to update https://github.com/dart-lang/leak_tracker/blob/main/doc%2Fleak_tracking%2FDETECT.md ? |
Hm, interesting. |
I updated the documentation in dart-lang/leak_tracker#245 |
Hm. |
It isn't part of the Flutter SDK, otherwise the dependency would be an SDK dependency and the repo tooling wouldn't flag it. Local means "in this repository", which it also isn't. It's just a random package from pub as far as the repo tooling is concerned. (I'd be happy to take a PR that makes the check cross-reference by querying the pub.dev API for any package that's not SDK and not local, and allowing anything with a Dart or Flutter official publisher.) Thus https://github.com/flutter/packages/pull/7546/files#r1757634961 |
589b82c
to
90ee2ca
Compare
Thank you for the insights. 90ee2ca made the ci pass |
@chunhtai I see you added the label "waiting for tree to go green"? Is there a bot that will automatically merge this PR once it is ready (like the flutter repository)? Or can I merge it by hand if all the checks are successful? |
I am not sure why it doesn't trigger auto merge, let me update the branch and see if it picks up this time |
4598267
to
63b1072
Compare
No it doesn't, that's why I'm having hard time understanding the issue 😅 |
4337935
to
0c41769
Compare
8515f64
to
fc9fd22
Compare
It looks like the failing test is also failing on |
33578de
to
350753f
Compare
350753f
to
1f1f45e
Compare
1f1f45e
to
ffe76a6
Compare
* main: (1187 commits) [various] Update example app minSdkVersions (flutter#8035) [go_router] Activate leak testing (flutter#7546) [in_app_purchase_storekit] Add restore purchases and receipts (flutter#7964) [interactive_media_ads] Adds remaining methods for internal wrapper of the Android native `BaseManager` (flutter#7943) [google_sign_in/google_identity_services] Clear-up documentation of callbacks in various APIs and uses of those APIs (flutter#8029) [flutter_svg] wasm compatibility (flutter#8014) Applied Gradle Plugins Declaratively for Multiple Plugin Example Apps (Part 2) (flutter#8019) Roll Flutter from 29d40f7f6826 to 73546b3b71a7 (20 revisions) (flutter#8028) [ci] Upload screenshots, logs, and Xcode test results for drive and integration_test runs (flutter#7430) Remove use_modular_headers! from Podfiles (flutter#7796) [camera_avfoundation] enable more than 30 fps (flutter#7394) Roll Flutter from 8591d0c16a6c to 29d40f7f6826 (25 revisions) (flutter#8027) [ci] Add vector_graphics and flutter_svg to autolabeler (flutter#8025) [vector_graphics_compiler] wasm compatibility (flutter#8021) [vector_graphics*] Relax dependency constraints of vector_graphics, vector_graphics_codec, vector_graphics_compiler, flutter_svg (flutter#8018) [various] Add `missing_code_block_language_in_doc_comment` lint to flutter/packages. (flutter#6473) [various] Update example apps to Kotlin 1.9.0 (flutter#7998) [go_router] add current state getter (flutter#7651) Applied Gradle Plugins Declaratively for Multiple Plugin Example Apps (flutter#7968) Roll Flutter from f86b77721524 to 8591d0c16a6c (16 revisions) (flutter#8015) ... # Conflicts: # packages/quick_actions/quick_actions/CHANGELOG.md # packages/quick_actions/quick_actions_ios/CHANGELOG.md # packages/quick_actions/quick_actions_platform_interface/CHANGELOG.md
flutter/packages@bb5a258...72356fd 2024-11-08 stuartmorgan@google.com [various] Update example app minSdkVersions (flutter/packages#8035) 2024-11-07 32538273+ValentinVignal@users.noreply.github.com [go_router] Activate leak testing (flutter/packages#7546) 2024-11-07 louisehsu@google.com [in_app_purchase_storekit] Add restore purchases and receipts (flutter/packages#7964) 2024-11-07 10687576+bparrishMines@users.noreply.github.com [interactive_media_ads] Adds remaining methods for internal wrapper of the Android native `BaseManager` (flutter/packages#7943) 2024-11-07 58529443+srujzs@users.noreply.github.com [google_sign_in/google_identity_services] Clear-up documentation of callbacks in various APIs and uses of those APIs (flutter/packages#8029) 2024-11-07 alex@mariuti.com [flutter_svg] wasm compatibility (flutter/packages#8014) 2024-11-06 jessiewong401@gmail.com Applied Gradle Plugins Declaratively for Multiple Plugin Example Apps (Part 2) (flutter/packages#8019) 2024-11-06 engine-flutter-autoroll@skia.org Roll Flutter from 29d40f7 to 73546b3 (20 revisions) (flutter/packages#8028) 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-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.