-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Roll mockito to 5.4.0 #3544
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
Roll mockito to 5.4.0 #3544
Conversation
The pinned version of `mockito` is incompatible with the latest released version of `test_api`, and therefore `test`. With flutter package pinning, the release of the flutter SDK that updates to the next version of `test_api` will break the version solve with these packages. Using a constraint that allows a range of versions of `mockito` should allow a valid version solve.
I found some |
Actually I tried to update some of the mocks that were generated with 5.3.2 on this branch, and they stay the same, so I guess the examples are fine too! dit@dit:/work/flutter/packages/packages/google_maps_flutter/google_maps_flutter_web/example$ cat integration_test/google_maps_controller_test.mocks.dart
// Mocks generated by Mockito 5.3.2 from annotations
// in google_maps_flutter_web_integration_tests/integration_test/google_maps_controller_test.dart.
// Do not manually edit this file. |
Hmm, I would expect at least the |
In a couple packages that are generating in a directory named `integration_test/` instead of `test/`, add a `generate_for` argument to run mockito against those tests. Remove a stale unused mock file. If a `build_runner build` had been run following the removal of the source file, with an asset graph from the build that included the file, it would have been removed. If the source file is removed and no builds are ever run with the asset graph from the build including it, the output will be ignored by the build system.
I added some |
Mockito 5.4.0 restricts mocks from sharing a name with a class, the import prefix does not work around the mockito check.
Edit: I found the link to the full log: https://api.cirrus-ci.com/v1/task/5467466374053888/logs/unit_test.log |
The newer SDK switches the argument in the original definition to a typedef, but the older SDK doesn't have that typedef.
The newer SDK switches the argument in the original definition to a typedef, but the older SDK doesn't have that typedef.
Thanks for digging in the unchanged mocks! @natebosch |
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.
Final version LGTM as well. Thanks!
Part of flutter/flutter#127226 Follow up to #3544. Version 5.4.0 from that PR is not new enough, see ``` Because mockito >=5.4.0 <5.4.1 depends on test_api >=0.2.1 <0.6.0 and every version of flutter_test from sdk depends on test_api 0.6.0, mockito >=5.4.0 <5.4.1 is incompatible with flutter_test from sdk. So, because quick_actions_platform_interface depends on both flutter_test from sdk and mockito 5.4.0, version solving failed. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8780090492483790881/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
Roll mockito to 5.4.0
Part of flutter/flutter#127226 Follow up to flutter/packages#3544. Version 5.4.0 from that PR is not new enough, see ``` Because mockito >=5.4.0 <5.4.1 depends on test_api >=0.2.1 <0.6.0 and every version of flutter_test from sdk depends on test_api 0.6.0, mockito >=5.4.0 <5.4.1 is incompatible with flutter_test from sdk. So, because quick_actions_platform_interface depends on both flutter_test from sdk and mockito 5.4.0, version solving failed. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8780090492483790881/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
Part of flutter/flutter#127226 Follow up to flutter/packages#3544. Version 5.4.0 from that PR is not new enough, see ``` Because mockito >=5.4.0 <5.4.1 depends on test_api >=0.2.1 <0.6.0 and every version of flutter_test from sdk depends on test_api 0.6.0, mockito >=5.4.0 <5.4.1 is incompatible with flutter_test from sdk. So, because quick_actions_platform_interface depends on both flutter_test from sdk and mockito 5.4.0, version solving failed. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8780090492483790881/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
Part of flutter/flutter#127226 Follow up to flutter/packages#3544. Version 5.4.0 from that PR is not new enough, see ``` Because mockito >=5.4.0 <5.4.1 depends on test_api >=0.2.1 <0.6.0 and every version of flutter_test from sdk depends on test_api 0.6.0, mockito >=5.4.0 <5.4.1 is incompatible with flutter_test from sdk. So, because quick_actions_platform_interface depends on both flutter_test from sdk and mockito 5.4.0, version solving failed. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8780090492483790881/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
Part of flutter/flutter#127226 Follow up to flutter/packages#3544. Version 5.4.0 from that PR is not new enough, see ``` Because mockito >=5.4.0 <5.4.1 depends on test_api >=0.2.1 <0.6.0 and every version of flutter_test from sdk depends on test_api 0.6.0, mockito >=5.4.0 <5.4.1 is incompatible with flutter_test from sdk. So, because quick_actions_platform_interface depends on both flutter_test from sdk and mockito 5.4.0, version solving failed. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8780090492483790881/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
Part of flutter/flutter#127226 Follow up to flutter/packages#3544. Version 5.4.0 from that PR is not new enough, see ``` Because mockito >=5.4.0 <5.4.1 depends on test_api >=0.2.1 <0.6.0 and every version of flutter_test from sdk depends on test_api 0.6.0, mockito >=5.4.0 <5.4.1 is incompatible with flutter_test from sdk. So, because quick_actions_platform_interface depends on both flutter_test from sdk and mockito 5.4.0, version solving failed. ``` https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8780090492483790881/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout
The pinned version of
mockito
is incompatible with the latest released version oftest_api
, and thereforetest
. With flutter package pinning, the release of the flutter SDK that updates to the next version oftest_api
will break the version solve with these packages. Use the5.4.0
version ofmockito
which is forwards compatible.This is required to unblock flutter/flutter#123350, flutter/flutter#123603