mirror of
https://github.com/flutter/packages.git
synced 2025-08-24 03:18:54 +08:00
Enable web integration tests in CI (#3738)
This commit is contained in:
@ -14,16 +14,18 @@ class DriveExamplesCommand extends PluginCommand {
|
||||
FileSystem fileSystem, {
|
||||
ProcessRunner processRunner = const ProcessRunner(),
|
||||
}) : super(packagesDir, fileSystem, processRunner: processRunner) {
|
||||
argParser.addFlag(kAndroid,
|
||||
help: 'Runs the Android implementation of the examples');
|
||||
argParser.addFlag(kIos,
|
||||
help: 'Runs the iOS implementation of the examples');
|
||||
argParser.addFlag(kLinux,
|
||||
help: 'Runs the Linux implementation of the examples');
|
||||
argParser.addFlag(kMacos,
|
||||
help: 'Runs the macOS implementation of the examples');
|
||||
argParser.addFlag(kWeb,
|
||||
help: 'Runs the web implementation of the examples');
|
||||
argParser.addFlag(kWindows,
|
||||
help: 'Runs the Windows implementation of the examples');
|
||||
argParser.addFlag(kIos,
|
||||
help: 'Runs the iOS implementation of the examples');
|
||||
argParser.addFlag(kAndroid,
|
||||
help: 'Runs the Android implementation of the examples');
|
||||
argParser.addOption(
|
||||
kEnableExperiment,
|
||||
defaultsTo: '',
|
||||
@ -51,6 +53,7 @@ class DriveExamplesCommand extends PluginCommand {
|
||||
final List<String> failingTests = <String>[];
|
||||
final bool isLinux = argResults[kLinux];
|
||||
final bool isMacos = argResults[kMacos];
|
||||
final bool isWeb = argResults[kWeb];
|
||||
final bool isWindows = argResults[kWindows];
|
||||
await for (Directory plugin in getPlugins()) {
|
||||
final String flutterCommand =
|
||||
@ -139,6 +142,13 @@ Tried searching for the following:
|
||||
'macos',
|
||||
]);
|
||||
}
|
||||
if (isWeb && isWebPlugin(plugin, fileSystem)) {
|
||||
driveArgs.addAll(<String>[
|
||||
'-d',
|
||||
'web-server',
|
||||
'--browser-name=chrome',
|
||||
]);
|
||||
}
|
||||
if (isWindows && isWindowsPlugin(plugin, fileSystem)) {
|
||||
driveArgs.addAll(<String>[
|
||||
'-d',
|
||||
@ -180,26 +190,30 @@ Tried searching for the following:
|
||||
|
||||
Future<bool> pluginSupportedOnCurrentPlatform(
|
||||
FileSystemEntity plugin, FileSystem fileSystem) async {
|
||||
final bool isAndroid = argResults[kAndroid];
|
||||
final bool isIOS = argResults[kIos];
|
||||
final bool isLinux = argResults[kLinux];
|
||||
final bool isMacos = argResults[kMacos];
|
||||
final bool isWeb = argResults[kWeb];
|
||||
final bool isWindows = argResults[kWindows];
|
||||
final bool isIOS = argResults[kIos];
|
||||
final bool isAndroid = argResults[kAndroid];
|
||||
if (isAndroid) {
|
||||
return (isAndroidPlugin(plugin, fileSystem));
|
||||
}
|
||||
if (isIOS) {
|
||||
return isIosPlugin(plugin, fileSystem);
|
||||
}
|
||||
if (isLinux) {
|
||||
return isLinuxPlugin(plugin, fileSystem);
|
||||
}
|
||||
if (isMacos) {
|
||||
return isMacOsPlugin(plugin, fileSystem);
|
||||
}
|
||||
if (isWeb) {
|
||||
return isWebPlugin(plugin, fileSystem);
|
||||
}
|
||||
if (isWindows) {
|
||||
return isWindowsPlugin(plugin, fileSystem);
|
||||
}
|
||||
if (isIOS) {
|
||||
return isIosPlugin(plugin, fileSystem);
|
||||
}
|
||||
if (isAndroid) {
|
||||
return (isAndroidPlugin(plugin, fileSystem));
|
||||
}
|
||||
// When we are here, no flags are specified. Only return true if the plugin
|
||||
// supports Android for legacy command support. TODO(cyanglaz): Make Android
|
||||
// flag also required like other platforms (breaking change).
|
||||
|
Reference in New Issue
Block a user