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
a228a17c
Unverified
Commit
a228a17c
authored
Nov 17, 2020
by
Casey Hillers
Committed by
GitHub
Nov 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[devicelab] LUCI builder flag (#70702)
parent
26ba1848
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
run.dart
dev/devicelab/bin/run.dart
+14
-2
cocoon.dart
dev/devicelab/lib/framework/cocoon.dart
+2
-2
cocoon_test.dart
dev/devicelab/test/cocoon_test.dart
+2
-2
No files found.
dev/devicelab/bin/run.dart
View file @
a228a17c
...
...
@@ -30,6 +30,12 @@ String localEngine;
/// The path to the engine "src/" directory.
String
localEngineSrcPath
;
/// Name of the LUCI builder this test is currently running on.
///
/// This is only passed on CI runs for Cocoon to be able to uniquely identify
/// this test run.
String
luciBuilder
;
/// Whether to exit on first test failure.
bool
exitOnFirstTestFailure
;
...
...
@@ -81,9 +87,10 @@ Future<void> main(List<String> rawArgs) async {
}
deviceId
=
args
[
'device-id'
]
as
String
;
exitOnFirstTestFailure
=
args
[
'exit'
]
as
bool
;
localEngine
=
args
[
'local-engine'
]
as
String
;
localEngineSrcPath
=
args
[
'local-engine-src-path'
]
as
String
;
exitOnFirstTestFailure
=
args
[
'exit'
]
as
bool
;
luciBuilder
=
args
[
'luci-builder'
]
as
String
;
serviceAccountTokenFile
=
args
[
'service-account-token-file'
]
as
String
;
silent
=
args
[
'silent'
]
as
bool
;
...
...
@@ -111,7 +118,8 @@ Future<void> _runTasks() async {
if
(
serviceAccountTokenFile
!=
null
)
{
final
Cocoon
cocoon
=
Cocoon
(
serviceAccountTokenPath:
serviceAccountTokenFile
);
await
cocoon
.
sendTaskResult
(
taskName:
taskName
,
result:
result
);
/// Cocoon references LUCI tasks by the [luciBuilder] instead of [taskName].
await
cocoon
.
sendTaskResult
(
builderName:
luciBuilder
,
result:
result
);
}
if
(!
result
.
succeeded
)
{
...
...
@@ -338,6 +346,10 @@ final ArgParser _argParser = ArgParser()
'locally. Defaults to
\
$FLUTTER_ENGINE
if set, or tries to guess at
\n
'
'the location based on the value of the --flutter-root option.'
,
)
..
addOption
(
'luci-builder'
,
help:
'[Flutter infrastructure] Name of the LUCI builder being run on.'
)
..
addFlag
(
'match-host-platform'
,
defaultsTo:
true
,
...
...
dev/devicelab/lib/framework/cocoon.dart
View file @
a228a17c
...
...
@@ -75,7 +75,7 @@ class Cocoon {
}
/// Send [TaskResult] to Cocoon.
Future
<
void
>
sendTaskResult
({
String
task
Name
,
TaskResult
result
})
async
{
Future
<
void
>
sendTaskResult
({
String
builder
Name
,
TaskResult
result
})
async
{
// Skip logging on test runs
Logger
.
root
.
level
=
Level
.
ALL
;
Logger
.
root
.
onRecord
.
listen
((
LogRecord
rec
)
{
...
...
@@ -85,7 +85,7 @@ class Cocoon {
final
Map
<
String
,
dynamic
>
status
=
<
String
,
dynamic
>{
'CommitBranch'
:
commitBranch
,
'CommitSha'
:
commitSha
,
'
TaskName'
:
task
Name
,
'
BuilderName'
:
builder
Name
,
'NewStatus'
:
result
.
succeeded
?
'Succeeded'
:
'Failed'
,
};
...
...
dev/devicelab/test/cocoon_test.dart
View file @
a228a17c
...
...
@@ -93,7 +93,7 @@ void main() {
final
TaskResult
result
=
TaskResult
.
success
(<
String
,
dynamic
>{});
// This should not throw an error.
await
cocoon
.
sendTaskResult
(
taskName:
'task
Abc'
,
result:
result
);
await
cocoon
.
sendTaskResult
(
builderName:
'builder
Abc'
,
result:
result
);
});
test
(
'throws client exception on non-200 responses'
,
()
async
{
...
...
@@ -106,7 +106,7 @@ void main() {
);
final
TaskResult
result
=
TaskResult
.
success
(<
String
,
dynamic
>{});
expect
(()
=>
cocoon
.
sendTaskResult
(
taskName:
'task
Abc'
,
result:
result
),
throwsA
(
isA
<
ClientException
>()));
expect
(()
=>
cocoon
.
sendTaskResult
(
builderName:
'builder
Abc'
,
result:
result
),
throwsA
(
isA
<
ClientException
>()));
});
});
...
...
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