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
79f377da
Unverified
Commit
79f377da
authored
Jul 27, 2021
by
Casey Hillers
Committed by
GitHub
Jul 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[devicelab] Only upload results on master (#87125)
parent
889ab838
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
cocoon.dart
dev/devicelab/lib/framework/cocoon.dart
+4
-1
cocoon_test.dart
dev/devicelab/test/cocoon_test.dart
+25
-0
No files found.
dev/devicelab/lib/framework/cocoon.dart
View file @
79f377da
...
...
@@ -98,7 +98,10 @@ class Cocoon {
resultsJson
[
'NewStatus'
]
=
testStatus
;
}
resultsJson
[
'TestFlaky'
]
=
isTestFlaky
??
false
;
await
_sendUpdateTaskRequest
(
resultsJson
);
const
List
<
String
>
supportedBranches
=
<
String
>[
'master'
];
if
(
supportedBranches
.
contains
(
resultsJson
[
'CommitBranch'
]))
{
await
_sendUpdateTaskRequest
(
resultsJson
);
}
}
/// Write the given parameters into an update task request and store the JSON in [resultsPath].
...
...
dev/devicelab/test/cocoon_test.dart
View file @
79f377da
...
...
@@ -178,6 +178,31 @@ void main() {
expect
(()
=>
cocoon
.
sendResultsPath
(
resultsPath:
resultsPath
),
throwsA
(
isA
<
ClientException
>()));
});
test
(
'does not upload results on non-supported branches'
,
()
async
{
// Any network failure would cause the upoad to fail
mockClient
=
MockClient
((
Request
request
)
async
=>
Response
(
''
,
500
));
cocoon
=
Cocoon
(
serviceAccountTokenPath:
serviceAccountTokenPath
,
fs:
fs
,
httpClient:
mockClient
,
requestRetryLimit:
0
,
);
const
String
resultsPath
=
'results.json'
;
const
String
updateTaskJson
=
'{'
'"CommitBranch":"stable",'
'"CommitSha":"
$commitSha
",'
'"BuilderName":"builderAbc",'
'"NewStatus":"Succeeded",'
'"ResultData":{"i":0.0,"j":0.0,"not_a_metric":"something"},'
'"BenchmarkScoreKeys":["i","j"]}'
;
fs
.
file
(
resultsPath
).
writeAsStringSync
(
updateTaskJson
);
// This will fail if it decided to upload results
await
cocoon
.
sendResultsPath
(
resultsPath:
resultsPath
);
});
});
group
(
'AuthenticatedCocoonClient'
,
()
{
...
...
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