From 60bd88df915880d23877bfc1602e8ddcf4c4dd2a Mon Sep 17 00:00:00 2001 From: Christopher Fujino Date: Wed, 3 Mar 2021 09:13:17 -0800 Subject: [PATCH] enable build test, roll engine, flag flip (#77154) * Tool flag flip, cp of #74444 & #74513 * Roll Engine * enable build test on stable --- bin/internal/engine.version | 2 +- dev/bots/test.dart | 54 +++++---------- packages/flutter_tools/lib/src/features.dart | 2 +- .../lib/src/isolated/resident_web_runner.dart | 9 +-- .../commands.shard/hermetic/config_test.dart | 8 +-- .../test/general.shard/features_test.dart | 68 ++++++++++--------- 6 files changed, 59 insertions(+), 84 deletions(-) diff --git a/bin/internal/engine.version b/bin/internal/engine.version index dcece4af077..1daead4852b 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -042c82b02c83c20e57a67d86a8d3b7677d983556 +40441def692f444660a11e20fac37af9050245ab diff --git a/dev/bots/test.dart b/dev/bots/test.dart index fecc3d2291f..0b729c63b8d 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -133,27 +133,6 @@ Future main(List args) async { print('$clock ${bold}Test successful.$reset'); } -/// Returns whether or not Linux desktop tests should be run. -/// -/// The branch restrictions here should stay in sync with features.dart. -bool _shouldRunLinux() { - return Platform.isLinux && (branchName != 'beta' && branchName != 'stable'); -} - -/// Returns whether or not macOS desktop tests should be run. -/// -/// The branch restrictions here should stay in sync with features.dart. -bool _shouldRunMacOS() { - return Platform.isMacOS && (branchName != 'beta' && branchName != 'stable'); -} - -/// Returns whether or not Windows desktop tests should be run. -/// -/// The branch restrictions here should stay in sync with features.dart. -bool _shouldRunWindows() { - return Platform.isWindows && (branchName != 'beta' && branchName != 'stable'); -} - /// Verify the Flutter Engine is the revision in /// bin/cache/internal/engine.version. Future _validateEngineHash() async { @@ -389,20 +368,19 @@ Future _runBuildTests() async { // distribution of costs, but the seed is fixed so that issues are reproducible. final List tests = [ for (final FileSystemEntity exampleDirectory in exampleDirectories) - () => _runExampleProjectBuildTests(exampleDirectory), - if (branchName != 'beta' && branchName != 'stable') - ...[ - // Web compilation tests. - () => _flutterBuildDart2js( - path.join('dev', 'integration_tests', 'web'), - path.join('lib', 'main.dart'), - ), - // Should not fail to compile with dart:io. - () => _flutterBuildDart2js( - path.join('dev', 'integration_tests', 'web_compile_tests'), - path.join('lib', 'dart_io_import.dart'), - ), - ], + () => _runExampleProjectBuildTests(exampleDirectory), + ...[ + // Web compilation tests. + () => _flutterBuildDart2js( + path.join('dev', 'integration_tests', 'web'), + path.join('lib', 'main.dart'), + ), + // Should not fail to compile with dart:io. + () => _flutterBuildDart2js( + path.join('dev', 'integration_tests', 'web_compile_tests'), + path.join('lib', 'dart_io_import.dart'), + ), + ], ]..shuffle(math.Random(0)); if (!await _runShardRunnerIndexOfTotalSubshard(tests)) { @@ -436,7 +414,7 @@ Future _runExampleProjectBuildTests(FileSystemEntity exampleDirectory) asy print('Example project ${path.basename(examplePath)} has no ios directory, skipping ipa'); } } - if (_shouldRunLinux()) { + if (Platform.isLinux) { if (Directory(path.join(examplePath, 'linux')).existsSync()) { await _flutterBuildLinux(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching); await _flutterBuildLinux(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching); @@ -444,7 +422,7 @@ Future _runExampleProjectBuildTests(FileSystemEntity exampleDirectory) asy print('Example project ${path.basename(examplePath)} has no linux directory, skipping Linux'); } } - if (_shouldRunMacOS()) { + if (Platform.isMacOS) { if (Directory(path.join(examplePath, 'macos')).existsSync()) { await _flutterBuildMacOS(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching); await _flutterBuildMacOS(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching); @@ -452,7 +430,7 @@ Future _runExampleProjectBuildTests(FileSystemEntity exampleDirectory) asy print('Example project ${path.basename(examplePath)} has no macos directory, skipping macOS'); } } - if (_shouldRunWindows()) { + if (Platform.isWindows) { if (Directory(path.join(examplePath, 'windows')).existsSync()) { await _flutterBuildWin32(examplePath, release: false, additionalArgs: additionalArgs, verifyCaching: verifyCaching); await _flutterBuildWin32(examplePath, release: true, additionalArgs: additionalArgs, verifyCaching: verifyCaching); diff --git a/packages/flutter_tools/lib/src/features.dart b/packages/flutter_tools/lib/src/features.dart index ec9374c5967..f168f680b05 100644 --- a/packages/flutter_tools/lib/src/features.dart +++ b/packages/flutter_tools/lib/src/features.dart @@ -452,4 +452,4 @@ class FeatureChannelSetting { final bool enabledByDefault; } -const bool flutterNext = false; +const bool flutterNext = true; diff --git a/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart b/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart index 3eeb152dc7b..2e1d911c3dc 100644 --- a/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart +++ b/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart @@ -185,14 +185,7 @@ abstract class ResidentWebRunner extends ResidentRunner { fire + globals.terminal.bolden(rawMessage), TerminalColor.red, ); - if (!flutterNext) { - globals.printStatus( - "Warning: Flutter's support for web development is not stable yet and hasn't"); - globals.printStatus('been thoroughly tested in production environments.'); - globals.printStatus('For more information see https://flutter.dev/web'); - globals.printStatus(''); - globals.printStatus(message); - } + globals.printStatus(message); const String quitMessage = 'To quit, press "q".'; if (device.device is! WebServerDevice) { globals.printStatus('For a more detailed help message, press "h". $quitMessage'); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/config_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/config_test.dart index aa1299ac8cf..248c63b209f 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/config_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/config_test.dart @@ -186,19 +186,19 @@ void main() { expect( testLogger.statusText, - containsIgnoringWhitespace('enable-web: true (Unavailable)'), + containsIgnoringWhitespace('enable-web: true'), ); expect( testLogger.statusText, - containsIgnoringWhitespace('enable-linux-desktop: true (Unavailable)'), + containsIgnoringWhitespace('enable-linux-desktop: true'), ); expect( testLogger.statusText, - containsIgnoringWhitespace('enable-windows-desktop: true (Unavailable)'), + containsIgnoringWhitespace('enable-windows-desktop: true'), ); expect( testLogger.statusText, - containsIgnoringWhitespace('enable-macos-desktop: true (Unavailable)'), + containsIgnoringWhitespace('enable-macos-desktop: true'), ); verifyNoAnalytics(); }, overrides: { diff --git a/packages/flutter_tools/test/general.shard/features_test.dart b/packages/flutter_tools/test/general.shard/features_test.dart index c85f440d0d0..d3c76653de4 100644 --- a/packages/flutter_tools/test/general.shard/features_test.dart +++ b/packages/flutter_tools/test/general.shard/features_test.dart @@ -79,25 +79,28 @@ void main() { testWithoutContext('flutter web help string', () { expect(flutterWebFeature.generateHelpMessage(), 'Enable or disable Flutter for web. ' - 'This setting will take effect on the master, dev, and beta channels.'); + 'This setting will take effect on the master, dev, beta, and stable channels.'); }); testWithoutContext('flutter macOS desktop help string', () { expect(flutterMacOSDesktopFeature.generateHelpMessage(), 'Enable or disable beta-quality support for desktop on macOS. ' - 'This setting will take effect on the master and dev channels.'); + 'This setting will take effect on the master, dev, beta, and stable channels. ' + 'Newer beta versions are available on the beta channel.'); }); testWithoutContext('flutter Linux desktop help string', () { expect(flutterLinuxDesktopFeature.generateHelpMessage(), 'Enable or disable beta-quality support for desktop on Linux. ' - 'This setting will take effect on the master and dev channels.'); + 'This setting will take effect on the master, dev, beta, and stable channels. ' + 'Newer beta versions are available on the beta channel.'); }); testWithoutContext('flutter Windows desktop help string', () { expect(flutterWindowsDesktopFeature.generateHelpMessage(), 'Enable or disable beta-quality support for desktop on Windows. ' - 'This setting will take effect on the master and dev channels.'); + 'This setting will take effect on the master, dev, beta, and stable channels. ' + 'Newer beta versions are available on the beta channel.'); }); testWithoutContext('help string on multiple channels', () { @@ -176,17 +179,18 @@ void main() { expect(featureFlags.isWebEnabled, true); }); - testWithoutContext('flutter web off by default on stable', () { + testWithoutContext('flutter web on by default on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); + when(mockFlutterConfig.getValue(any) as bool).thenReturn(null); - expect(featureFlags.isWebEnabled, false); + expect(featureFlags.isWebEnabled, true); }); - testWithoutContext('flutter web not enabled with config on stable', () { + testWithoutContext('flutter web enabled with config on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockFlutterConfig.getValue('enable-web') as bool).thenReturn(true); - expect(featureFlags.isWebEnabled, false); + expect(featureFlags.isWebEnabled, true); }); testWithoutContext('flutter web not enabled with environment variable on stable', () { @@ -244,18 +248,18 @@ void main() { expect(featureFlags.isMacOSEnabled, false); }); - testWithoutContext('flutter macos desktop not enabled with config on beta', () { + testWithoutContext('flutter macos desktop enabled with config on beta', () { when(mockFlutterVerion.channel).thenReturn('beta'); when(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true); - expect(featureFlags.isMacOSEnabled, false); + expect(featureFlags.isMacOSEnabled, true); }); - testWithoutContext('flutter macos desktop not enabled with environment variable on beta', () { + testWithoutContext('flutter macos desktop enabled with environment variable on beta', () { when(mockFlutterVerion.channel).thenReturn('beta'); when(mockPlatform.environment).thenReturn({'FLUTTER_MACOS': 'true'}); - expect(featureFlags.isMacOSEnabled, false); + expect(featureFlags.isMacOSEnabled, true); }); testWithoutContext('flutter macos desktop off by default on stable', () { @@ -264,18 +268,18 @@ void main() { expect(featureFlags.isMacOSEnabled, false); }); - testWithoutContext('flutter macos desktop not enabled with config on stable', () { + testWithoutContext('flutter macos desktop enabled with config on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true); - expect(featureFlags.isMacOSEnabled, false); + expect(featureFlags.isMacOSEnabled, true); }); - testWithoutContext('flutter macos desktop not enabled with environment variable on stable', () { + testWithoutContext('flutter macos desktop enabled with environment variable on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockPlatform.environment).thenReturn({'FLUTTER_MACOS': 'true'}); - expect(featureFlags.isMacOSEnabled, false); + expect(featureFlags.isMacOSEnabled, true); }); /// Flutter Linux Desktop @@ -325,18 +329,18 @@ void main() { expect(featureFlags.isLinuxEnabled, false); }); - testWithoutContext('flutter linux desktop not enabled with config on beta', () { + testWithoutContext('flutter linux desktop enabled with config on beta', () { when(mockFlutterVerion.channel).thenReturn('beta'); when(mockFlutterConfig.getValue('enable-linux-desktop') as bool).thenReturn(true); - expect(featureFlags.isLinuxEnabled, false); + expect(featureFlags.isLinuxEnabled, true); }); - testWithoutContext('flutter linux desktop not enabled with environment variable on beta', () { + testWithoutContext('flutter linux desktop enabled with environment variable on beta', () { when(mockFlutterVerion.channel).thenReturn('beta'); when(mockPlatform.environment).thenReturn({'FLUTTER_LINUX': 'true'}); - expect(featureFlags.isLinuxEnabled, false); + expect(featureFlags.isLinuxEnabled, true); }); testWithoutContext('flutter linux desktop off by default on stable', () { @@ -345,18 +349,18 @@ void main() { expect(featureFlags.isLinuxEnabled, false); }); - testWithoutContext('flutter linux desktop not enabled with config on stable', () { + testWithoutContext('flutter linux desktop enabled with config on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockFlutterConfig.getValue('enable-linux-desktop') as bool).thenReturn(true); - expect(featureFlags.isLinuxEnabled, false); + expect(featureFlags.isLinuxEnabled, true); }); - testWithoutContext('flutter linux desktop not enabled with environment variable on stable', () { + testWithoutContext('flutter linux desktop enabled with environment variable on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockPlatform.environment).thenReturn({'FLUTTER_LINUX': 'true'}); - expect(featureFlags.isLinuxEnabled, false); + expect(featureFlags.isLinuxEnabled, true); }); /// Flutter Windows desktop. @@ -406,18 +410,18 @@ void main() { expect(featureFlags.isWindowsEnabled, false); }); - testWithoutContext('flutter windows desktop not enabled with config on beta', () { + testWithoutContext('flutter windows desktop enabled with config on beta', () { when(mockFlutterVerion.channel).thenReturn('beta'); when(mockFlutterConfig.getValue('enable-windows-desktop') as bool).thenReturn(true); - expect(featureFlags.isWindowsEnabled, false); + expect(featureFlags.isWindowsEnabled, true); }); - testWithoutContext('flutter windows desktop not enabled with environment variable on beta', () { + testWithoutContext('flutter windows desktop enabled with environment variable on beta', () { when(mockFlutterVerion.channel).thenReturn('beta'); when(mockPlatform.environment).thenReturn({'FLUTTER_WINDOWS': 'true'}); - expect(featureFlags.isWindowsEnabled, false); + expect(featureFlags.isWindowsEnabled, true); }); testWithoutContext('flutter windows desktop off by default on stable', () { @@ -426,18 +430,18 @@ void main() { expect(featureFlags.isWindowsEnabled, false); }); - testWithoutContext('flutter windows desktop not enabled with config on stable', () { + testWithoutContext('flutter windows desktop enabled with config on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockFlutterConfig.getValue('enable-windows-desktop') as bool).thenReturn(true); - expect(featureFlags.isWindowsEnabled, false); + expect(featureFlags.isWindowsEnabled, true); }); - testWithoutContext('flutter windows desktop not enabled with environment variable on stable', () { + testWithoutContext('flutter windows desktop enabled with environment variable on stable', () { when(mockFlutterVerion.channel).thenReturn('stable'); when(mockPlatform.environment).thenReturn({'FLUTTER_WINDOWS': 'true'}); - expect(featureFlags.isWindowsEnabled, false); + expect(featureFlags.isWindowsEnabled, true); }); }); }