mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
enable build test, roll engine, flag flip (#77154)
* Tool flag flip, cp of #74444 & #74513 * Roll Engine * enable build test on stable
This commit is contained in:
parent
044f2cf560
commit
60bd88df91
@ -1 +1 @@
|
||||
042c82b02c83c20e57a67d86a8d3b7677d983556
|
||||
40441def692f444660a11e20fac37af9050245ab
|
||||
|
||||
@ -133,27 +133,6 @@ Future<void> main(List<String> 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<void> _validateEngineHash() async {
|
||||
@ -389,20 +368,19 @@ Future<void> _runBuildTests() async {
|
||||
// distribution of costs, but the seed is fixed so that issues are reproducible.
|
||||
final List<ShardRunner> tests = <ShardRunner>[
|
||||
for (final FileSystemEntity exampleDirectory in exampleDirectories)
|
||||
() => _runExampleProjectBuildTests(exampleDirectory),
|
||||
if (branchName != 'beta' && branchName != 'stable')
|
||||
...<ShardRunner>[
|
||||
// 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),
|
||||
...<ShardRunner>[
|
||||
// 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<void> _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<void> _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<void> _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);
|
||||
|
||||
@ -452,4 +452,4 @@ class FeatureChannelSetting {
|
||||
final bool enabledByDefault;
|
||||
}
|
||||
|
||||
const bool flutterNext = false;
|
||||
const bool flutterNext = true;
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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: <Type, Generator>{
|
||||
|
||||
@ -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<bool>(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<bool>(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<bool>(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(<String, String>{'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<bool>(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(<String, String>{'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<bool>(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(<String, String>{'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<bool>(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(<String, String>{'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<bool>(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(<String, String>{'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<bool>(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(<String, String>{'FLUTTER_WINDOWS': 'true'});
|
||||
|
||||
expect(featureFlags.isWindowsEnabled, false);
|
||||
expect(featureFlags.isWindowsEnabled, true);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user