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

[go_router] Activate leak testing #7546

Merged

Conversation

ValentinVignal
Copy link
Contributor

Pre-launch Checklist

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

@ValentinVignal
Copy link
Contributor Author

cc @polina-c

@ValentinVignal
Copy link
Contributor Author

I didn't modify the version number and the CHANGELOG, should I do it or is it not necessary for this?

Copy link
Contributor

@chunhtai chunhtai left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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

cc @stuartmorgan

Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor Author

@ValentinVignal ValentinVignal Aug 29, 2024

Choose a reason for hiding this comment

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

Copy link

@polina-c polina-c Aug 30, 2024

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@polina-c
Copy link

Thanks for pushing it!
Looks good to me. Will let @chunhtai to stamp.

Copy link
Contributor

@chunhtai chunhtai left a 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
Copy link
Contributor

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

@chunhtai chunhtai added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Sep 5, 2024
@chunhtai
Copy link
Contributor

chunhtai commented Sep 5, 2024

override reason: test only.

@chunhtai
Copy link
Contributor

chunhtai commented Sep 5, 2024

I am not sure what happen to the ci, can you try to rebase and see if that passes the ci.

@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch from f4912f7 to 0e103fe Compare September 6, 2024 17:14
@chunhtai
Copy link
Contributor

chunhtai commented Sep 6, 2024

looks like the test was trying to run
flutter test --color --platform=chrome --web-renderer=canvaskit" in /b/s/w/ir/x/w/packages/packages/go_router

@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch from 0e103fe to 6595059 Compare September 9, 2024 09:13
@ValentinVignal
Copy link
Contributor Author

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 ?

@polina-c
Copy link

polina-c commented Sep 9, 2024

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.
Yes, please. Thank you!

@ValentinVignal
Copy link
Contributor Author

I updated the documentation in dart-lang/leak_tracker#245

@chunhtai
Copy link
Contributor

@polina-c
Copy link

Hm.
Leak tracker is not recognized as local dependency, while it is part of Flutter.

@stuartmorgan
Copy link
Contributor

Leak tracker is not recognized as local dependency, while it is part of Flutter.

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

@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch from 589b82c to 90ee2ca Compare September 13, 2024 16:14
@ValentinVignal
Copy link
Contributor Author

Thank you for the insights.

90ee2ca made the ci pass

@ValentinVignal
Copy link
Contributor Author

@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?

@chunhtai
Copy link
Contributor

@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

@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch 3 times, most recently from 4598267 to 63b1072 Compare September 24, 2024 15:49
@ValentinVignal
Copy link
Contributor Author

Does this pr touches video_player package? if not, this may just be an outdated branch, can you try rebase?

No it doesn't, that's why I'm having hard time understanding the issue 😅

@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch from 4337935 to 0c41769 Compare October 7, 2024 06:14
@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch 2 times, most recently from 8515f64 to fc9fd22 Compare October 16, 2024 05:12
@ValentinVignal
Copy link
Contributor Author

It looks like the failing test is also failing on main. After it is fixed, this PR should be good to go

@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch 4 times, most recently from 33578de to 350753f Compare October 24, 2024 06:50
@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch from 350753f to 1f1f45e Compare October 25, 2024 03:47
@ValentinVignal ValentinVignal force-pushed the go-router/activate-leak-tracking branch from 1f1f45e to ffe76a6 Compare October 26, 2024 11:58
@chunhtai chunhtai added autosubmit Merge PR when tree becomes green via auto submit App and removed waiting for tree to go green labels Nov 7, 2024
@auto-submit auto-submit bot merged commit 6d6cc9a into flutter:main Nov 7, 2024
76 checks passed
@ValentinVignal ValentinVignal deleted the go-router/activate-leak-tracking branch November 8, 2024 01:58
sinyu1012 added a commit to sinyu1012/packages that referenced this pull request Nov 8, 2024
* 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 8, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 11, 2024
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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: go_router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants