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
80278423
Unverified
Commit
80278423
authored
Aug 23, 2022
by
keyonghan
Committed by
GitHub
Aug 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy artifacts to `applicationBinaryPath` when specified for build+test separation (#109879)
parent
6d655510
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
build_test_task.dart
dev/devicelab/lib/tasks/build_test_task.dart
+6
-4
gallery.dart
dev/devicelab/lib/tasks/gallery.dart
+11
-1
build_test_task_test.dart
dev/devicelab/test/tasks/build_test_task_test.dart
+3
-3
No files found.
dev/devicelab/lib/tasks/build_test_task.dart
View file @
80278423
...
@@ -59,6 +59,7 @@ abstract class BuildTestTask {
...
@@ -59,6 +59,7 @@ abstract class BuildTestTask {
}
}
section
(
'BUILDING APPLICATION'
);
section
(
'BUILDING APPLICATION'
);
await
flutter
(
'build'
,
options:
getBuildArgs
(
deviceOperatingSystem
));
await
flutter
(
'build'
,
options:
getBuildArgs
(
deviceOperatingSystem
));
copyArtifacts
();
});
});
}
}
...
@@ -83,6 +84,11 @@ abstract class BuildTestTask {
...
@@ -83,6 +84,11 @@ abstract class BuildTestTask {
/// Args passed to flutter drive to test the built application.
/// Args passed to flutter drive to test the built application.
List
<
String
>
getTestArgs
(
DeviceOperatingSystem
deviceOperatingSystem
,
String
deviceId
)
=>
throw
UnimplementedError
(
'getTestArgs is not implemented'
);
List
<
String
>
getTestArgs
(
DeviceOperatingSystem
deviceOperatingSystem
,
String
deviceId
)
=>
throw
UnimplementedError
(
'getTestArgs is not implemented'
);
/// Copy artifacts to [applicationBinaryPath] if specified.
///
/// This is needed when running from CI, so that LUCI recipes know where to locate and upload artifacts to GCS.
void
copyArtifacts
()
=>
throw
UnimplementedError
(
'copyArtifacts is not implemented'
);
/// Logic to construct [TaskResult] from this test's results.
/// Logic to construct [TaskResult] from this test's results.
Future
<
TaskResult
>
parseTaskResult
()
=>
throw
UnimplementedError
(
'parseTaskResult is not implemented'
);
Future
<
TaskResult
>
parseTaskResult
()
=>
throw
UnimplementedError
(
'parseTaskResult is not implemented'
);
...
@@ -100,10 +106,6 @@ abstract class BuildTestTask {
...
@@ -100,10 +106,6 @@ abstract class BuildTestTask {
throw
Exception
(
'Both build and test should not be passed. Pass only one.'
);
throw
Exception
(
'Both build and test should not be passed. Pass only one.'
);
}
}
if
(
buildOnly
&&
applicationBinaryPath
!=
null
)
{
throw
Exception
(
'Application binary path is only used for tests'
);
}
if
(!
testOnly
)
{
if
(!
testOnly
)
{
await
build
();
await
build
();
}
}
...
...
dev/devicelab/lib/tasks/gallery.dart
View file @
80278423
...
@@ -212,6 +212,16 @@ class GalleryTransitionBuildTest extends BuildTestTask {
...
@@ -212,6 +212,16 @@ class GalleryTransitionBuildTest extends BuildTestTask {
final
String
testOutputDirectory
=
Platform
.
environment
[
'FLUTTER_TEST_OUTPUTS_DIR'
]
??
'
${galleryDirectory.path}
/build'
;
final
String
testOutputDirectory
=
Platform
.
environment
[
'FLUTTER_TEST_OUTPUTS_DIR'
]
??
'
${galleryDirectory.path}
/build'
;
@override
void
copyArtifacts
()
{
if
(
applicationBinaryPath
!=
null
)
{
copy
(
file
(
'
${galleryDirectory.path}
/build/app/outputs/flutter-apk/app-profile.apk'
),
Directory
(
applicationBinaryPath
!),
);
}
}
@override
@override
List
<
String
>
getBuildArgs
(
DeviceOperatingSystem
deviceOperatingSystem
)
{
List
<
String
>
getBuildArgs
(
DeviceOperatingSystem
deviceOperatingSystem
)
{
return
<
String
>[
return
<
String
>[
...
@@ -310,7 +320,7 @@ class GalleryTransitionBuildTest extends BuildTestTask {
...
@@ -310,7 +320,7 @@ class GalleryTransitionBuildTest extends BuildTestTask {
@override
@override
String
getApplicationBinaryPath
()
{
String
getApplicationBinaryPath
()
{
if
(
applicationBinaryPath
!=
null
)
{
if
(
applicationBinaryPath
!=
null
)
{
return
applicationBinaryPath
!
;
return
'
${applicationBinaryPath!}
/app-profile.apk'
;
}
}
return
'build/app/outputs/flutter-apk/app-profile.apk'
;
return
'build/app/outputs/flutter-apk/app-profile.apk'
;
...
...
dev/devicelab/test/tasks/build_test_task_test.dart
View file @
80278423
...
@@ -78,13 +78,13 @@ void main() {
...
@@ -78,13 +78,13 @@ void main() {
expect
(
result
.
message
,
'Task failed: Exception: Both build and test should not be passed. Pass only one.'
);
expect
(
result
.
message
,
'Task failed: Exception: Both build and test should not be passed. Pass only one.'
);
});
});
test
(
'
throws exception
when build and application binary arg are given'
,
()
async
{
test
(
'
copies artifacts
when build and application binary arg are given'
,
()
async
{
final
TaskResult
result
=
await
runTask
(
final
TaskResult
result
=
await
runTask
(
'smoke_test_build_test'
,
'smoke_test_build_test'
,
taskArgs:
<
String
>[
'--build'
,
'--application-binary-path=test
.apk
'
],
taskArgs:
<
String
>[
'--build'
,
'--application-binary-path=test'
],
deviceId:
'FAKE_SUCCESS'
,
deviceId:
'FAKE_SUCCESS'
,
isolateParams:
isolateParams
,
isolateParams:
isolateParams
,
);
);
expect
(
result
.
message
,
'
Task failed: Exception: Application binary path is only used for tests
'
);
expect
(
result
.
message
,
'
No tests run
'
);
});
});
}
}
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