Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Deferred components integration test app #88030

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

Merged
merged 11 commits into from
Aug 16, 2021

Conversation

GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Aug 11, 2021

This adds a deferred components integration test app that uses flutter drive to test framework side deferred components loading and a bash script to build and install a split app.

Files of interest for reviewers: test_driver/main_test.dart, run_release_test.sh, lib/main.dart

Replaces the flaky test mentioned in #72312

@flutter-dashboard flutter-dashboard bot added framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Aug 11, 2021
@google-cla google-cla bot added the cla: yes label Aug 11, 2021
@GaryQian GaryQian added f: integration_test The flutter/packages/integration_test plugin platform-android Android applications specifically t: flutter driver "flutter driver", flutter_drive, or a driver test work in progress; do not review labels Aug 11, 2021
@skia-gold
Copy link

Gold has detected about 6 new digest(s) on patchset 2.
View them at https://flutter-gold.skia.org/cl/github/88030

@skia-gold
Copy link

Gold has detected about 2 new digest(s) on patchset 3.
View them at https://flutter-gold.skia.org/cl/github/88030

@GaryQian GaryQian force-pushed the deferredintegration branch from 5eebf16 to 577396a Compare August 11, 2021 19:53
@skia-gold
Copy link

Gold has detected about 6 new digest(s) on patchset 4.
View them at https://flutter-gold.skia.org/cl/github/88030

@GaryQian GaryQian force-pushed the deferredintegration branch 2 times, most recently from 0076a49 to 81fb4df Compare August 12, 2021 06:45
@GaryQian GaryQian changed the title [WIP] Deferred components integration test app Deferred components integration test app Aug 12, 2021
@GaryQian GaryQian requested a review from blasten August 12, 2021 06:46
@GaryQian GaryQian force-pushed the deferredintegration branch from ee2a40b to 153cd6b Compare August 12, 2021 19:43
@GaryQian GaryQian requested a review from Piinks as a code owner August 12, 2021 19:43
@blasten
Copy link

blasten commented Aug 12, 2021

it would need to remove the binary files

@GaryQian GaryQian removed the request for review from Piinks August 12, 2021 19:52
@GaryQian GaryQian force-pushed the deferredintegration branch from 5f17537 to 84006b1 Compare August 12, 2021 20:49
Comment on lines 26 to 46
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
Copy link

Choose a reason for hiding this comment

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

Suggested change
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}

Copy link

Choose a reason for hiding this comment

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

we should probably fix this in the template

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, I think this is just some bad file merging on my end. Templates seem fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, I think this is just some bad file merging on my end. Templates seem fine.

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
Copy link

Choose a reason for hiding this comment

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

any thoughts about using Dart for this, similar to some of the other integration tests? For example:
https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart#L156

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only one of the commands is a flutter build command, everything else is a mix of adb, bundletool, etc. I think a shell script may be clearer and more concise for now at least.

@@ -0,0 +1,35 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Copy link

Choose a reason for hiding this comment

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

could it use dev/tools/bin/generate_gradle_lockfiles.dar to generate this file as well as the .lockfile?

here's how to use it: https://github.com/flutter/flutter/blob/master/dev/tools/bin/generate_gradle_lockfiles.dart#L16-L19

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 that script actually creates both the settings.gradle and build.gradle. Though some of it may be useful, it does generate files that do not implement some of the config needed for deferred components.

Actually, I think I need to go in and add a skip to make sure it doesn't produce incompatible configs for deferred components.

Copy link

Choose a reason for hiding this comment

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

The script could skip overriding settings.gradle.

I'm mostly concerned about the lockfiles since those help to keep transient dependencies consistent between builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I changed to skip settings.gradle. build.gradle is generated now and lockfiles are in.

color: Colors.blue,
);
}
}
Copy link

Choose a reason for hiding this comment

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

nit: eof

Copy link

Choose a reason for hiding this comment

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

nit: a new line at the end of file


@override
Widget build(BuildContext context) {
print('Running deferred code');
Copy link

@blasten blasten Aug 13, 2021

Choose a reason for hiding this comment

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

minor: could this be a named constant? something like testSentinel='Running deferred code'

@blasten
Copy link

blasten commented Aug 13, 2021

👏 awesome! just some minor comments

@GaryQian GaryQian requested a review from blasten August 13, 2021 08:48
Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM

Could we use the Android emulators you added on LUCI to test apps like this?

sleep 12
exit
"
adb logcat -d -s "flutter" > build/app/outputs/bundle/release/run_logcat.log
Copy link

Choose a reason for hiding this comment

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

this works if we are using android emulators with -wipe-data or if there's nothing cached between CI runs. Do you know if this would be the case?

e.g. consider the case where job 1 runs, then job 2 runs and sees the same log line from job 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll go find out :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added filters/timestamping to ensure only the latest run's logs are tracked.

@GaryQian
Copy link
Contributor Author

Could we use the Android emulators you added on LUCI to test apps like this?

Yes, that is the primary reason why I am writing this test app.

@blasten
Copy link

blasten commented Aug 14, 2021

Awesome! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically t: flutter driver "flutter driver", flutter_drive, or a driver test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants