Skip to content

Commit 5840236

Browse files
authored
Re-land: "Remove Cocoon from dev/devicelab, keeping Skia perf stats upload" (#165755)
🚫 **Merge after** https://flutter-review.googlesource.com/c/recipes/+/64300. --- This reverts commit 0a2d9f5.
1 parent 0a2d9f5 commit 5840236

File tree

8 files changed

+247
-770
lines changed

8 files changed

+247
-770
lines changed

dev/devicelab/bin/test_runner.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import 'dart:io';
88
import 'package:args/command_runner.dart';
99

1010
import 'package:flutter_devicelab/command/test.dart';
11-
import 'package:flutter_devicelab/command/upload_results.dart';
11+
import 'package:flutter_devicelab/command/upload_metrics.dart';
1212

1313
final CommandRunner<void> runner =
1414
CommandRunner<void>('devicelab_runner', 'DeviceLab test runner for recording test results')
1515
..addCommand(TestCommand())
16-
..addCommand(UploadResultsCommand());
16+
..addCommand(UploadMetricsCommand());
1717

1818
Future<void> main(List<String> rawArgs) async {
1919
unawaited(
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:args/command_runner.dart';
6+
7+
import '../framework/metrics_center.dart';
8+
9+
class UploadMetricsCommand extends Command<void> {
10+
UploadMetricsCommand() {
11+
argParser.addOption('results-file', help: 'Test results JSON to upload to Cocoon.');
12+
argParser.addOption('commit-time', help: 'Commit time in UNIX timestamp');
13+
argParser.addOption(
14+
'task-name',
15+
help: '[Flutter infrastructure] Name of the task being run on.',
16+
);
17+
argParser.addOption(
18+
'benchmark-tags',
19+
help: '[Flutter infrastructure] Benchmark tags to surface on Skia Perf',
20+
);
21+
}
22+
23+
@override
24+
String get name => 'upload-metrics';
25+
26+
@override
27+
String get description => '[Flutter infrastructure] Upload results data to Cocoon/Skia Perf';
28+
29+
@override
30+
Future<void> run() async {
31+
final String? resultsPath = argResults!['results-file'] as String?;
32+
final String? commitTime = argResults!['commit-time'] as String?;
33+
final String? taskName = argResults!['task-name'] as String?;
34+
final String? benchmarkTags = argResults!['benchmark-tags'] as String?;
35+
36+
// Upload metrics to skia perf from test runner when `resultsPath` is specified.
37+
if (resultsPath != null) {
38+
await uploadToSkiaPerf(resultsPath, commitTime, taskName, benchmarkTags);
39+
print('Successfully uploaded metrics to skia perf');
40+
}
41+
}
42+
}

dev/devicelab/lib/command/upload_results.dart

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)