Add performance tests for the new gallery (#55181)
This commit is contained in:
@@ -501,6 +501,22 @@ String jsonEncode(dynamic data) {
|
||||
return const JsonEncoder.withIndent(' ').convert(data) + '\n';
|
||||
}
|
||||
|
||||
Future<void> getNewGallery(String revision, Directory galleryDir) async {
|
||||
section('Get New Flutter Gallery!');
|
||||
|
||||
if (exists(galleryDir)) {
|
||||
galleryDir.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
await inDirectory<void>(galleryDir.parent, () async {
|
||||
await exec('git', <String>['clone', 'https://github.com/flutter/gallery.git']);
|
||||
});
|
||||
|
||||
await inDirectory<void>(galleryDir, () async {
|
||||
await exec('git', <String>['checkout', revision]);
|
||||
});
|
||||
}
|
||||
|
||||
void checkNotNull(Object o1,
|
||||
[Object o2 = 1,
|
||||
Object o3 = 1,
|
||||
|
||||
27
dev/devicelab/lib/tasks/new_gallery.dart
Normal file
27
dev/devicelab/lib/tasks/new_gallery.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
|
||||
import '../framework/framework.dart';
|
||||
import '../framework/utils.dart';
|
||||
|
||||
class NewGalleryPerfTest extends PerfTest {
|
||||
NewGalleryPerfTest(this.galleryDir) : super(galleryDir.path, 'test_driver/transitions_perf.dart', 'transitions');
|
||||
|
||||
@override
|
||||
Future<TaskResult> run() async {
|
||||
// Manually roll the new gallery version for now. If the new gallery repo
|
||||
// turns out to be updated frequently in the future, we can set up an auto
|
||||
// roller to update this version.
|
||||
await getNewGallery('59489e5571ddf554fc62ef52e9b16f1fed291026', galleryDir);
|
||||
return await super.run();
|
||||
}
|
||||
|
||||
final Directory galleryDir;
|
||||
}
|
||||
Reference in New Issue
Block a user