Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 41625b6

Browse files
authored
Test flutter run does not have unexpected engine logs (#116798)
1 parent 601f48c commit 41625b6

File tree

7 files changed

+151
-2
lines changed

7 files changed

+151
-2
lines changed

.ci.yaml

+79-1
Original file line numberDiff line numberDiff line change
@@ -3206,6 +3206,30 @@ targets:
32063206
["devicelab", "android", "mac"]
32073207
task_name: microbenchmarks
32083208

3209+
- name: Mac_android run_debug_test_android
3210+
recipe: devicelab/devicelab_drone
3211+
bringup: true
3212+
presubmit: false
3213+
runIf:
3214+
- dev/**
3215+
timeout: 60
3216+
properties:
3217+
tags: >
3218+
["devicelab", "android", "mac"]
3219+
task_name: run_debug_test_android
3220+
3221+
- name: Mac_arm64_android run_debug_test_android
3222+
recipe: devicelab/devicelab_drone
3223+
bringup: true
3224+
presubmit: false
3225+
runIf:
3226+
- dev/**
3227+
timeout: 60
3228+
properties:
3229+
tags: >
3230+
["devicelab", "android", "mac", "arm64"]
3231+
task_name: run_debug_test_android
3232+
32093233
- name: Mac_android run_release_test
32103234
recipe: devicelab/devicelab_drone
32113235
presubmit: false
@@ -3879,8 +3903,42 @@ targets:
38793903
- bin/**
38803904
- .ci.yaml
38813905

3906+
- name: Mac run_debug_test_macos
3907+
recipe: devicelab/devicelab_drone
3908+
bringup: true
3909+
timeout: 60
3910+
properties:
3911+
dependencies: >-
3912+
[
3913+
{"dependency": "xcode", "version": "14a5294e"},
3914+
{"dependency": "gems", "version": "v3.3.14"}
3915+
]
3916+
tags: >
3917+
["devicelab", "hostonly", "mac"]
3918+
task_name: run_debug_test_macos
3919+
runIf:
3920+
- dev/**
3921+
- packages/flutter_tools/**
3922+
- bin/**
3923+
- .ci.yaml
3924+
3925+
- name: Mac_arm64_ios run_debug_test_macos
3926+
recipe: devicelab/devicelab_drone
3927+
bringup: true
3928+
timeout: 60
3929+
properties:
3930+
tags: >
3931+
["devicelab", "ios", "mac", "arm64"]
3932+
task_name: run_debug_test_macos
3933+
runIf:
3934+
- dev/**
3935+
- packages/flutter_tools/**
3936+
- bin/**
3937+
- .ci.yaml
3938+
38823939
- name: Mac run_release_test_macos
38833940
recipe: devicelab/devicelab_drone
3941+
presubmit: false
38843942
timeout: 60
38853943
properties:
38863944
dependencies: >-
@@ -4193,9 +4251,29 @@ targets:
41934251
- bin/**
41944252
- .ci.yaml
41954253

4196-
- name: Windows run_release_test_windows
4254+
- name: Windows run_debug_test_windows
4255+
recipe: devicelab/devicelab_drone
41974256
bringup: true
4257+
presubmit: false
4258+
timeout: 60
4259+
properties:
4260+
dependencies: >-
4261+
[
4262+
{"dependency": "vs_build", "version": "version:vs2019"}
4263+
]
4264+
tags: >
4265+
["devicelab", "hostonly", "windows"]
4266+
task_name: run_debug_test_windows
4267+
runIf:
4268+
- dev/**
4269+
- packages/flutter_tools/**
4270+
- bin/**
4271+
- .ci.yaml
4272+
4273+
- name: Windows run_release_test_windows
41984274
recipe: devicelab/devicelab_drone
4275+
bringup: true
4276+
presubmit: false
41994277
timeout: 60
42004278
properties:
42014279
dependencies: >-

TESTOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@
249249
/dev/devicelab/bin/tasks/plugin_lint_mac.dart @stuartmorgan @flutter/plugin
250250
/dev/devicelab/bin/tasks/plugin_test_ios.dart @jmagman @flutter/ios
251251
/dev/devicelab/bin/tasks/plugin_test.dart @stuartmorgan @flutter/plugin
252+
/dev/devicelab/bin/tasks/run_debug_test_android.dart @zanderso @flutter/tool
253+
/dev/devicelab/bin/tasks/run_debug_test_macos.dart @cbracken @flutter/tool
254+
/dev/devicelab/bin/tasks/run_debug_test_windows.dart @loic-sharma @flutter/tool
252255
/dev/devicelab/bin/tasks/run_release_test_macos.dart @cbracken @flutter/tool
253256
/dev/devicelab/bin/tasks/run_release_test_windows.dart @loic-sharma @flutter/tool
254257
/dev/devicelab/bin/tasks/technical_debt__cost.dart @HansMuller @flutter/framework

dev/devicelab/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You must set the `ANDROID_SDK_ROOT` environment variable to run
4444
tests on Android. If you have a local build of the Flutter engine, then you have
4545
a copy of the Android SDK at `.../engine/src/third_party/android_tools/sdk`.
4646

47-
You can find where your Android SDK is using `flutter doctor`.
47+
You can find where your Android SDK is using `flutter doctor -v`.
4848

4949
### Warnings
5050

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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:flutter_devicelab/framework/framework.dart';
6+
import 'package:flutter_devicelab/tasks/run_tests.dart';
7+
8+
void main() {
9+
task(createAndroidRunDebugTest());
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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:flutter_devicelab/framework/devices.dart';
6+
import 'package:flutter_devicelab/framework/framework.dart';
7+
import 'package:flutter_devicelab/tasks/run_tests.dart';
8+
9+
void main() {
10+
deviceOperatingSystem = DeviceOperatingSystem.macos;
11+
task(createMacOSRunDebugTest());
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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:flutter_devicelab/framework/devices.dart';
6+
import 'package:flutter_devicelab/framework/framework.dart';
7+
import 'package:flutter_devicelab/tasks/run_tests.dart';
8+
9+
Future<void> main() async {
10+
deviceOperatingSystem = DeviceOperatingSystem.windows;
11+
await task(createWindowsRunDebugTest());
12+
}

dev/devicelab/lib/tasks/run_tests.dart

+34
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,25 @@ import '../framework/framework.dart';
1111
import '../framework/task_result.dart';
1212
import '../framework/utils.dart';
1313

14+
TaskFunction createAndroidRunDebugTest() {
15+
return AndroidRunOutputTest(release: false);
16+
}
17+
1418
TaskFunction createAndroidRunReleaseTest() {
1519
return AndroidRunOutputTest(release: true);
1620
}
1721

22+
TaskFunction createMacOSRunDebugTest() {
23+
return DesktopRunOutputTest(
24+
// TODO(cbracken): https://github.com/flutter/flutter/issues/87508#issuecomment-1043753201
25+
// Switch to dev/integration_tests/ui once we have CocoaPods working on M1 Macs.
26+
'${flutterDirectory.path}/examples/hello_world',
27+
'lib/main.dart',
28+
release: false,
29+
allowStderr: true,
30+
);
31+
}
32+
1833
TaskFunction createMacOSRunReleaseTest() {
1934
return DesktopRunOutputTest(
2035
// TODO(cbracken): https://github.com/flutter/flutter/issues/87508#issuecomment-1043753201
@@ -26,6 +41,14 @@ TaskFunction createMacOSRunReleaseTest() {
2641
);
2742
}
2843

44+
TaskFunction createWindowsRunDebugTest() {
45+
return DesktopRunOutputTest(
46+
'${flutterDirectory.path}/dev/integration_tests/ui',
47+
'lib/empty.dart',
48+
release: false,
49+
);
50+
}
51+
2952
TaskFunction createWindowsRunReleaseTest() {
3053
return DesktopRunOutputTest(
3154
'${flutterDirectory.path}/dev/integration_tests/ui',
@@ -168,6 +191,10 @@ abstract class RunOutputTask {
168191
}
169192
);
170193

194+
static final RegExp _engineLogRegex = RegExp(
195+
r'\[(VERBOSE|INFO|WARNING|ERROR|FATAL):.+\(\d+\)\]',
196+
);
197+
171198
/// The directory where the app under test is defined.
172199
final String testDirectory;
173200
/// The main entry-point file of the application, as run on the device.
@@ -232,6 +259,13 @@ abstract class RunOutputTask {
232259
throw 'flutter run ${release ? '--release' : ''} had unexpected output on standard error.';
233260
}
234261

262+
final List<String> engineLogs = List<String>.from(
263+
stdout.where(_engineLogRegex.hasMatch),
264+
);
265+
if (engineLogs.isNotEmpty) {
266+
throw 'flutter run had unexpected Flutter engine logs $engineLogs';
267+
}
268+
235269
return verify(stdout, stderr);
236270
});
237271
}

0 commit comments

Comments
 (0)