Revert "Skip staging test update to cocoon in test runner (#88835)" (#88971)

This reverts commit 884dfc260d.
This commit is contained in:
keyonghan
2021-08-26 09:41:22 -07:00
committed by GitHub
parent b0950fd567
commit b67e264203
4 changed files with 29 additions and 59 deletions

View File

@@ -41,14 +41,21 @@ class UploadResultsCommand extends Command<void> {
final String? testStatus = argResults!['test-status'] as String?;
final String? commitTime = argResults!['commit-time'] as String?;
// Upload metrics to skia perf from test runner when `resultsPath` is specified.
if (resultsPath != null) {
await uploadToSkiaPerf(resultsPath, commitTime);
print('Successfully uploaded metrics to skia perf');
// Upload metrics to metrics_center from test runner when `commitTime` is specified. This
// is mainly for testing purpose.
// The upload step will be skipped from cocoon once this is validated.
// TODO(keyong): remove try block to block test when this is validated to work https://github.com/flutter/flutter/issues/88484
try {
if (commitTime != null) {
await uploadToMetricsCenter(resultsPath, commitTime);
print('Successfully uploaded metrics to metrics center');
}
} on Exception catch (e, stacktrace) {
print('Uploading metrics failure: $e\n\n$stacktrace');
}
final Cocoon cocoon = Cocoon(serviceAccountTokenPath: serviceAccountTokenFile);
return cocoon.sendTaskStatus(
return cocoon.sendResultsPath(
resultsPath: resultsPath,
isTestFlaky: testFlakyStatus == 'True',
gitBranch: gitBranch,