Migrate gallery/transitions_perf test to e2e#62064
Migrate gallery/transitions_perf test to e2e#62064fluttergithubbot merged 24 commits intoflutter:masterfrom CareF:gallery_e2e
Conversation
|
Currently which is defined in the gallery app: flutter/dev/integration_tests/flutter_gallery/lib/gallery/home.dart Lines 172 to 180 in 78efd3e So if we still want to keep avoiding timeline in the solution, we need to modify the app for sending a signal about the transition, or we can just ignore this. @liyuqian what do you think? Decided not to track this metric. |
|
removed the transition count because I can't decide which frame is the exact frame after transition, due to different epoch in FrameTiming and in DateTime |
dev/devicelab/manifest.yaml
Outdated
There was a problem hiding this comment.
Great! Once this is proved to work, let's add ios and ios32 versions of this in another PR as those are currently flaky.
dev/integration_tests/flutter_gallery/test_driver/e2e_util.dart
Outdated
Show resolved
Hide resolved
dev/integration_tests/flutter_gallery/test_driver/e2e_util.dart
Outdated
Show resolved
Hide resolved
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
A lot of the following code is very similar to runDemo in https://github.com/flutter/flutter/blob/master/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart.
As we plan to preserve both Flutter driver timeline perf tests and e2e FrameTiming perf tests for a while (partially because timeline still has a lot more information that FrameTiming doesn't), it's probably better to use a single piece of code in both places. Maybe now is a good opportunity to let FlutterDriver implements WidgetController so we can share the code?
This would guarantee that driver tests and e2e tests are measuring similar animations, and avoid the risk that someone changes one test and forget to update another.
There was a problem hiding this comment.
It's hard. WidgetController has everything depending on a binding (it can be a test binding or a real binding), but FlutterDriver doesn't have a binding. And the finder in WidgetController and that in FlutterDriver don't share base class.
There was a problem hiding this comment.
So to do that, the path in my opinion would be to write a mixin separating the controlling part (not the setting up part) of WidgetController and share this with FlutterDriver, and similarly for both finders. Even with that, there are some APIs doing the same thing but are named differently, meaning the result will be a breaking change. If we still consider abandon flutter_driver for driving the test, I don't think it will be worth it.
There was a problem hiding this comment.
Hmm... your concerns seems to be very legitimate. In that case, for Flutter driver timeline perf tests, can we just control the test inside transitions_perf.dart which is running on device instead of transitions_perf_test.dart? Then it seems that the host side transitions_perf_test.dart only needs to send a signal to device to start the control sequence (and the host will start capturing the timeline tracing events). The device-side code in transitions_perf.dart should be shareable with the E2E test?
There was a problem hiding this comment.
Haven't tried but sounds do-able. If that's the case the issue I mentioned above about using WidgetController and thus #62640 becomes necessary, and the measured result may be different with the original flutter_driver ones because it's almost a new test (a host-driven and self-driven hybrid test). Will try after #62640 lands .
There was a problem hiding this comment.
3e83f94 is an implementation of making flutter drive test share the driving code with the e2e test (making it a hybrid of host-driven and self-driven).
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart
Outdated
Show resolved
Hide resolved
dev/devicelab/lib/tasks/gallery.dart
Outdated
There was a problem hiding this comment.
According to our discussion earlier today, it seems that we're not planning to measure transition duration in the e2e test. If so, why do we still do this Firebase specific work as only e2e tests can run on Firebase?
There was a problem hiding this comment.
This piece is shared with the original flutter_driver based transition_perf test. I just moved it into an if so in the e2e it doesn't go through this by not providing a transition_duration file name. I don't know why it talks about firebase.
There was a problem hiding this comment.
Ah, I didn't realize this code was already there before your PR. It seems to be added by @yjbanov 4 years ago https://github.com/flutter/flutter/blame/30aef0a3b9611763f8e60985e7cca9cb30c1ea6a/dev/devicelab/lib/tasks/gallery.dart#L47.
Yegor: do you still remember why we're doing this as I'm pretty sure we're not using Firebase test lab until very recently? What could happen today if we remove it (the gallery transition test is still not running on Firebase yet)?
There was a problem hiding this comment.
I now removed this extra work, but I'll wait to see if there's anything breaking that we didn't realize.
|
@liyuqian Now it's ready for review again. The last commit share the The commit above (3e83f94) is removed and will be landed in another PR if we decided to use it. |
|
@dnfield I removed those duplicate code here, as it's relevant for creating the necessary java code as part of e2e firebase test lab support. |
There was a problem hiding this comment.
If we plan to use this file both in e2e and flutter_driver-timeline tests, maybe we should rename this file?
There was a problem hiding this comment.
Nope, this file is not reused as a whole. For the reused version run_demos function will be in a separate file.
dev/integration_tests/flutter_gallery/test_driver/e2e_utils.dart
Outdated
Show resolved
Hide resolved
dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart
Outdated
Show resolved
Hide resolved
|
This pull request is not suitable for automatic merging in its current state.
|
Description
Migrating gallery/transitions_perf test to e2e, hopefully it can solve the flaky issue for the test.
Related Issues
#30641, #60559, #61458
Tests
This is itself a test
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.