From 6b2f3bc1137ccfb1b9371295d1eed656bc2cfee0 Mon Sep 17 00:00:00 2001 From: Yegor Date: Tue, 11 May 2021 13:15:36 -0700 Subject: [PATCH] add web e2e and smoke tests to the long running test shard (#82281) --- dev/bots/test.dart | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 69ea696a5a..6f014fe4c7 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -833,6 +833,16 @@ Future _runWebUnitTests() async { /// Coarse-grained integration tests running on the Web. Future _runWebLongRunningTests() async { final List tests = [ + () => _runFlutterDriverWebTest( + testAppDirectory: path.join(flutterRoot, 'dev', 'integration_tests', 'web_e2e_tests'), + target: 'test_driver/text_editing_integration.dart', + buildMode: 'profile', + ), + () => _runFlutterDriverWebTest( + testAppDirectory: path.join(flutterRoot, 'examples', 'hello_world'), + target: 'test_driver/smoke_web_engine.dart', + buildMode: 'profile', + ), () => _runGalleryE2eWebTest('debug'), () => _runGalleryE2eWebTest('debug', canvasKit: true), () => _runGalleryE2eWebTest('profile'), @@ -846,6 +856,36 @@ Future _runWebLongRunningTests() async { await _stopChromeDriver(); } +Future _runFlutterDriverWebTest({ + @required String target, + @required String buildMode, + @required String testAppDirectory, +}) async { + print('${green}Running web_e2e_test $target in $buildMode mode.$reset'); + await runCommand( + flutter, + [ 'clean' ], + workingDirectory: testAppDirectory, + ); + await runCommand( + flutter, + [ + 'drive', + '--target=$target', + '--browser-name=chrome', + '--no-sound-null-safety', + '-d', + 'web-server', + '--$buildMode', + ], + workingDirectory: testAppDirectory, + environment: { + 'FLUTTER_WEB': 'true', + }, + ); + print('${green}Integration test passed.$reset'); +} + /// Returns the commit hash of the flutter/plugins repository that's rolled in. /// /// The flutter/plugins repository is a downstream dependency, it is only used @@ -1029,6 +1069,17 @@ Future _runGalleryE2eWebTest(String buildMode, { bool canvasKit = false }) print('${green}Integration test passed.$reset'); } +/// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +/// !!! WARNING WARNING WARNING WARNING WARNING WARNING!!! +/// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +/// +/// Do not put any more tests here. This shard is not properly subsharded. +/// Adding more tests here will linearly increase the runtime of the shard +/// making the overall Flutter CI build longer. Consider adding tests to +/// [_runWebLongRunningTests] instead (increasing subshard count if necessary). +/// +// TODO(yjbanov): increase subshard count in _runWebLongRunningTests and retire +// this shard. Future _runWebIntegrationTests() async { await _runWebStackTraceTest('profile', 'lib/stack_trace.dart'); await _runWebStackTraceTest('release', 'lib/stack_trace.dart');