Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove named parameters
  • Loading branch information
nturgut committed Nov 10, 2020
commit 18127900828a56da52ac6e8645ff01f53d231a88
47 changes: 23 additions & 24 deletions lib/web_ui/dev/integration_tests_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ class IntegrationTestsManager {
IntegrationArguments.fromBrowser(_browser);
final int exitCode = await runProcess(
executable,
arguments.getTestArguments(testName, mode,
isCanvaskitBackend: canvaskitBackend),
arguments.getTestArguments(testName, mode, canvaskitBackend),
workingDirectory: directory.path,
environment: enviroment,
);

if (exitCode != 0) {
final String command = arguments.getCommandToRun(testName, mode);
final String command =
arguments.getCommandToRun(testName, mode, canvaskitBackend);
io.stderr
.writeln('ERROR: Failed to run test. Exited with exit code $exitCode'
'. To run $testName locally use the following command:'
Expand Down Expand Up @@ -422,16 +422,16 @@ abstract class IntegrationArguments {
}
}

List<String> getTestArguments(String testName, String mode,
{bool isCanvaskitBackend = false});
List<String> getTestArguments(
String testName, String mode, bool isCanvaskitBackend);

String getCommandToRun(String testName, String mode);
String getCommandToRun(String testName, String mode, bool isCanvaskitBackend);
}

/// Arguments to give `flutter drive` to run the integration tests on Chrome.
class ChromeIntegrationArguments extends IntegrationArguments {
List<String> getTestArguments(String testName, String mode,
{bool isCanvaskitBackend = false}) {
List<String> getTestArguments(
String testName, String mode, bool isCanvaskitBackend) {
return <String>[
'drive',
'--target=test_driver/${testName}',
Expand All @@ -446,8 +446,8 @@ class ChromeIntegrationArguments extends IntegrationArguments {
];
}

String getCommandToRun(String testName, String mode,
{bool isCanvaskitBackend = false}) {
String getCommandToRun(
String testName, String mode, bool isCanvaskitBackend) {
String statementToRun = 'flutter drive '
'--target=test_driver/${testName} -d web-server --$mode '
'--browser-name=chrome --local-engine=host_debug_unopt';
Expand All @@ -464,8 +464,8 @@ class ChromeIntegrationArguments extends IntegrationArguments {

/// Arguments to give `flutter drive` to run the integration tests on Firefox.
class FirefoxIntegrationArguments extends IntegrationArguments {
List<String> getTestArguments(String testName, String mode,
{bool isCanvaskitBackend = false}) {
List<String> getTestArguments(
String testName, String mode, bool isCanvaskitBackend) {
return <String>[
'drive',
'--target=test_driver/${testName}',
Expand All @@ -479,11 +479,10 @@ class FirefoxIntegrationArguments extends IntegrationArguments {
];
}

String getCommandToRun(String testName, String mode,
{bool isCanvaskitBackend = false}) {
String getCommandToRun(
String testName, String mode, bool isCanvaskitBackend) {
final String arguments =
getTestArguments(testName, mode, isCanvaskitBackend: isCanvaskitBackend)
.join(' ');
getTestArguments(testName, mode, isCanvaskitBackend).join(' ');
return 'flutter $arguments';
}
}
Expand All @@ -492,8 +491,8 @@ class FirefoxIntegrationArguments extends IntegrationArguments {
class SafariIntegrationArguments extends IntegrationArguments {
SafariIntegrationArguments();

List<String> getTestArguments(String testName, String mode,
{bool isCanvaskitBackend = false}) {
List<String> getTestArguments(
String testName, String mode, bool isCanvaskitBackend) {
return <String>[
'drive',
'--target=test_driver/${testName}',
Expand All @@ -506,11 +505,10 @@ class SafariIntegrationArguments extends IntegrationArguments {
];
}

String getCommandToRun(String testName, String mode,
{bool isCanvaskitBackend = false}) {
String getCommandToRun(
String testName, String mode, bool isCanvaskitBackend) {
final String arguments =
getTestArguments(testName, mode, isCanvaskitBackend: isCanvaskitBackend)
.join(' ');
getTestArguments(testName, mode, isCanvaskitBackend).join(' ');
return 'flutter $arguments';
}
}
Expand Down Expand Up @@ -538,9 +536,10 @@ class IntegrationTestsArgumentParser {
/// `blockedTestsListsMapForModes` list for the relevant compile mode.
String buildMode;

/// Whether to use html or canvaskit backend.
/// Whether to use html, canvaskit or auto for web renderer.
///
/// If not set html rendering backend will be used.
/// If not set all backends will be used one after another for integration
/// tests. If set only the provided option will be used.
String webRenderer;

void populateOptions(ArgParser argParser) {
Expand Down