Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
2d688804
Unverified
Commit
2d688804
authored
Apr 12, 2021
by
Jenn Magder
Committed by
GitHub
Apr 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce number of project creates in gradle_plugin_*_apk_tests (#80171)
parent
436ca01e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
63 deletions
+27
-63
gradle_plugin_fat_apk_test.dart
dev/devicelab/bin/tasks/gradle_plugin_fat_apk_test.dart
+3
-9
gradle_plugin_light_apk_test.dart
dev/devicelab/bin/tasks/gradle_plugin_light_apk_test.dart
+23
-53
try_builders.json
dev/try_builders.json
+1
-1
No files found.
dev/devicelab/bin/tasks/gradle_plugin_fat_apk_test.dart
View file @
2d688804
...
...
@@ -25,7 +25,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -44,9 +44,7 @@ Future<void> main() async {
'lib/x86/libapp.so'
,
'lib/x86_64/libapp.so'
,
],
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleRelease without explicit target platform'
);
await
inDirectory
(
pluginProject
.
exampleAndroidPath
,
()
{
...
...
@@ -59,7 +57,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -73,9 +71,7 @@ Future<void> main() async {
],
apkFiles
);
checkCollectionDoesNotContain
<
String
>(
debugAssets
,
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleRelease with target platform = android-arm, android-arm64'
);
await
inDirectory
(
pluginProject
.
exampleAndroidPath
,
()
{
...
...
@@ -89,7 +85,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -101,9 +97,7 @@ Future<void> main() async {
],
apkFiles
);
checkCollectionDoesNotContain
<
String
>(
debugAssets
,
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleRelease with '
'target platform = android-arm, android-arm64 and split per ABI'
);
...
...
dev/devicelab/bin/tasks/gradle_plugin_light_apk_test.dart
View file @
2d688804
...
...
@@ -27,7 +27,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -45,9 +45,7 @@ Future<void> main() async {
'lib/x86/libapp.so'
,
'lib/x86_64/libapp.so'
,
],
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleDebug with target platform = android-x86'
);
// This is used by `flutter run`
await
inDirectory
(
pluginProject
.
exampleAndroidPath
,
()
{
...
...
@@ -61,7 +59,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -77,9 +75,7 @@ Future<void> main() async {
'lib/x86/libapp.so'
,
'lib/x86_64/libapp.so'
,
],
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleDebug with target platform = android-x64'
);
// This is used by `flutter run`
...
...
@@ -94,7 +90,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
apkFiles
=
await
getFilesInApk
(
pluginProject
.
debugApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -110,9 +106,7 @@ Future<void> main() async {
'lib/x86/libapp.so'
,
'lib/x86_64/libapp.so'
,
],
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleRelease with target platform = android-arm'
);
await
inDirectory
(
pluginProject
.
exampleAndroidPath
,
()
{
...
...
@@ -126,7 +120,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -140,9 +134,7 @@ Future<void> main() async {
'lib/arm64-v8a/libflutter.so'
,
'lib/arm64-v8a/libapp.so'
,
],
apkFiles
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'APK content for task assembleRelease with target platform = android-arm64'
);
await
inDirectory
(
pluginProject
.
exampleAndroidPath
,
()
{
...
...
@@ -156,7 +148,7 @@ Future<void> main() async {
);
});
final
Iterable
<
String
>
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
apkFiles
=
await
getFilesInApk
(
pluginProject
.
releaseApkPath
);
checkCollectionContains
<
String
>(<
String
>[
...
flutterAssets
,
...
...
@@ -187,9 +179,7 @@ Future<void> main() async {
if
(
errorMessage
!=
null
)
{
throw
TaskResult
.
failure
(
errorMessage
);
}
});
await
runProjectTest
((
FlutterProject
project
)
async
{
section
(
'gradlew assembleProfile'
);
await
inDirectory
(
project
.
rootPath
,
()
{
return
flutter
(
...
...
@@ -200,9 +190,7 @@ Future<void> main() async {
],
);
});
});
await
runProjectTest
((
FlutterProject
project
)
async
{
section
(
'gradlew assembleLocal (custom debug build)'
);
await
project
.
addCustomBuildType
(
'local'
,
initWith:
'debug'
);
await
project
.
runGradleTask
(
'assembleLocal'
);
...
...
@@ -263,7 +251,7 @@ Future<void> main() async {
await
runProjectTest
((
FlutterProject
project
)
async
{
section
(
'gradlew on build script with error'
);
await
project
.
introduceError
();
final
ProcessResult
result
=
await
inDirectory
(
project
.
rootPath
,
()
{
ProcessResult
result
=
await
inDirectory
(
project
.
rootPath
,
()
{
return
executeFlutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--release'
,
...
...
@@ -273,7 +261,7 @@ Future<void> main() async {
if
(
result
.
exitCode
==
0
)
throw
failure
(
'Gradle did not exit with error as expected'
,
result
);
final
String
output
=
'
${result.stdout}
\n
${result.stderr}
'
;
String
output
=
'
${result.stdout}
\n
${result.stderr}
'
;
if
(
output
.
contains
(
'GradleException'
)
||
output
.
contains
(
'Failed to notify'
)
||
output
.
contains
(
'at org.gradle'
))
...
...
@@ -283,29 +271,10 @@ Future<void> main() async {
throw
failure
(
'Gradle output should contain a readable error message'
,
result
);
});
await
runProjectTest
((
FlutterProject
project
)
async
{
section
(
'gradlew assembleDebug forwards stderr'
);
await
project
.
introducePubspecError
();
final
ProcessResult
result
=
await
inDirectory
(
project
.
rootPath
,
()
{
return
executeFlutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--release'
,
]);
});
if
(
result
.
exitCode
==
0
)
throw
failure
(
'Gradle did not exit with error as expected'
,
result
);
final
String
output
=
'
${result.stdout}
\n
${result.stderr}
'
;
if
(!
output
.
contains
(
'No file or variants found for asset: lib/gallery/example_code.dart.'
))
throw
failure
(
output
,
result
);
});
await
runProjectTest
((
FlutterProject
project
)
async
{
section
(
'flutter build apk on build script with error'
);
await
project
.
introduceError
();
final
ProcessResult
result
=
await
inDirectory
(
project
.
rootPath
,
()
{
result
=
await
inDirectory
(
project
.
rootPath
,
()
{
return
executeFlutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--release'
,
...
...
@@ -314,7 +283,7 @@ Future<void> main() async {
if
(
result
.
exitCode
==
0
)
throw
failure
(
'flutter build apk should fail when Gradle does'
,
result
);
final
String
output
=
'
${result.stdout}
\n
${result.stderr}
'
;
output
=
'
${result.stdout}
\n
${result.stderr}
'
;
if
(!
output
.
contains
(
'Build failed'
))
throw
failure
(
'flutter build apk output should contain a readable Gradle error message'
,
...
...
@@ -325,20 +294,21 @@ Future<void> main() async {
result
);
});
await
runPluginProjectTest
((
FlutterPluginProject
pluginProject
)
async
{
section
(
'gradlew assembleDebug on plugin example'
);
await
inDirectory
(
pluginProject
.
exampleAndroidPath
,
()
{
return
flutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--debug'
,
],
);
await
runProjectTest
((
FlutterProject
project
)
async
{
section
(
'gradlew assembleDebug forwards stderr'
);
await
project
.
introducePubspecError
();
final
ProcessResult
result
=
await
inDirectory
(
project
.
rootPath
,
()
{
return
executeFlutter
(
'build'
,
options:
<
String
>[
'apk'
,
'--release'
,
]);
});
if
(!
File
(
pluginProject
.
debugApkPath
).
existsSync
())
throw
TaskResult
.
failure
(
'Gradle did not produce an apk file at the expected place'
);
if
(
result
.
exitCode
==
0
)
throw
failure
(
'Gradle did not exit with error as expected'
,
result
);
final
String
output
=
'
${result.stdout}
\n
${result.stderr}
'
;
if
(!
output
.
contains
(
'No file or variants found for asset: lib/gallery/example_code.dart.'
))
throw
failure
(
output
,
result
);
});
return
TaskResult
.
success
(
null
);
...
...
dev/try_builders.json
View file @
2d688804
...
...
@@ -493,7 +493,7 @@
"name"
:
"Mac gradle_plugin_light_apk_test"
,
"repo"
:
"flutter"
,
"task_name"
:
"mac_gradle_plugin_light_apk_test"
,
"enabled"
:
fals
e
,
"enabled"
:
tru
e
,
"run_if"
:
[
"dev/**"
,
"bin/**"
]
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment