Add basic codegen app to be used for integration testing and benchmarks (#27257)
This commit is contained in:
20
dev/devicelab/bin/tasks/codegen_integration_test.dart
Normal file
20
dev/devicelab/bin/tasks/codegen_integration_test.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2019 The Chromium 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:path/path.dart' as path;
|
||||
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
final Directory codegenAppPath = dir(path.join(flutterDirectory.path, 'dev/integration_tests/codegen'));
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createCodegenerationIntegrationTest());
|
||||
}
|
||||
@@ -61,6 +61,16 @@ TaskFunction createAndroidSemanticsIntegrationTest() {
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createCodegenerationIntegrationTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/codegen',
|
||||
'lib/main.dart',
|
||||
environment: <String, String>{
|
||||
'FLUTTER_EXPERIMENTAL_BUILD': 'true'
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
TaskFunction createFlutterCreateOfflineTest() {
|
||||
return () async {
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_create_test.');
|
||||
@@ -83,12 +93,14 @@ class DriverTest {
|
||||
this.testDirectory,
|
||||
this.testTarget, {
|
||||
this.extraOptions = const <String>[],
|
||||
this.environment = const <String, String>{},
|
||||
}
|
||||
);
|
||||
|
||||
final String testDirectory;
|
||||
final String testTarget;
|
||||
final List<String> extraOptions;
|
||||
final Map<String, String> environment;
|
||||
|
||||
Future<TaskResult> call() {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
@@ -107,7 +119,7 @@ class DriverTest {
|
||||
deviceId,
|
||||
];
|
||||
options.addAll(extraOptions);
|
||||
await flutter('drive', options: options);
|
||||
await flutter('drive', options: options, environment: Map<String, String>.from(environment));
|
||||
|
||||
return TaskResult.success(null);
|
||||
});
|
||||
|
||||
@@ -76,6 +76,14 @@ tasks:
|
||||
stage: devicelab_win
|
||||
required_agent_capabilities: ["windows/android"]
|
||||
|
||||
codegen_integration_test:
|
||||
description: >
|
||||
Runs codegeneration and verifies that it can execute
|
||||
correctly.
|
||||
stage: devicelab_win
|
||||
required_agent_capabilities: ["windows/android"]
|
||||
flaky: true
|
||||
|
||||
flutter_gallery_android__compile:
|
||||
description: >
|
||||
Collects various performance metrics of compiling the Flutter
|
||||
|
||||
Reference in New Issue
Block a user