[devicelab] migrate new gallery benchmarks to local copy. (#143545)

This is the next step in archiving flutter/gallery - move devicelab tests to use the local copy.
This commit is contained in:
Jonah Williams
2024-02-15 14:32:38 -08:00
committed by GitHub
parent cef33536aa
commit 27cacca011
13 changed files with 52 additions and 166 deletions

View File

@@ -2,36 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io';
import '../framework/task_result.dart';
import '../framework/utils.dart';
import '../versions/gallery.dart' show galleryVersion;
import 'perf_tests.dart';
class NewGalleryPerfTest extends PerfTest {
NewGalleryPerfTest(
this.galleryDir, {
NewGalleryPerfTest({
String timelineFileName = 'transitions',
String dartDefine = '',
super.enableImpeller,
super.timeoutSeconds,
super.forceOpenGLES,
}) : super(
galleryDir.path,
'${flutterDirectory.path}/dev/integration_tests/new_gallery',
'test_driver/transitions_perf.dart',
timelineFileName,
dartDefine: dartDefine,
createPlatforms: <String>['android', 'ios', 'web']
);
@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(galleryVersion, galleryDir);
return super.run();
}
final Directory galleryDir;
}

View File

@@ -1185,6 +1185,7 @@ class PerfTest {
this.enableImpeller,
this.forceOpenGLES,
this.disablePartialRepaint = false,
this.createPlatforms = const <String>[],
}): _resultFilename = resultFilename;
const PerfTest.e2e(
@@ -1204,6 +1205,7 @@ class PerfTest {
this.enableImpeller,
this.forceOpenGLES,
this.disablePartialRepaint = false,
this.createPlatforms = const <String>[],
}) : saveTraceFile = false, timelineFileName = null, _resultFilename = resultFilename;
/// The directory where the app under test is defined.
@@ -1274,6 +1276,10 @@ class PerfTest {
/// Additional flags for `--dart-define` to control the test
final String dartDefine;
/// Additional platforms to create with `flutter create` before running
/// the test.
final List<String> createPlatforms;
Future<TaskResult> run() {
return internalRun();
}
@@ -1295,6 +1301,15 @@ class PerfTest {
final String? localEngineHost = localEngineHostFromEnv;
final String? localEngineSrcPath = localEngineSrcPathFromEnv;
if (createPlatforms.isNotEmpty) {
await flutter('create', options: <String>[
'--platforms',
createPlatforms.join(','),
'--no-overwrite',
'.'
]);
}
bool changedPlist = false;
bool changedManifest = false;