Skip to content

Explicitly pass the web renderer into the tests. #6140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions script/tool/lib/src/dart_test_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ class DartTestCommand extends PackageLoopingCommand {
platform = 'chrome';
}

// All the web tests assume the html renderer currently.
final String? webRenderer = (platform == 'chrome') ? 'html' : null;
bool passed;
if (package.requiresFlutter()) {
passed = await _runFlutterTests(package, platform: platform);
passed = await _runFlutterTests(package, platform: platform, webRenderer: webRenderer);
} else {
passed = await _runDartTests(package, platform: platform);
}
Expand All @@ -109,7 +111,7 @@ class DartTestCommand extends PackageLoopingCommand {

/// Runs the Dart tests for a Flutter package, returning true on success.
Future<bool> _runFlutterTests(RepositoryPackage package,
{String? platform}) async {
{String? platform, String? webRenderer}) async {
final String experiment = getStringArg(kEnableExperiment);

final int exitCode = await processRunner.runAndStream(
Expand All @@ -121,6 +123,7 @@ class DartTestCommand extends PackageLoopingCommand {
// Flutter defaults to VM mode (under a different name) and explicitly
// setting it is deprecated, so pass nothing in that case.
if (platform != null && platform != 'vm') '--platform=$platform',
if (webRenderer != null) '--web-renderer=$webRenderer',
],
workingDir: package.directory,
);
Expand Down
1 change: 1 addition & 0 deletions script/tool/lib/src/drive_examples_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class DriveExamplesCommand extends PackageLoopingCommand {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
if (platform.environment.containsKey('CHROME_EXECUTABLE'))
'--chrome-binary=${platform.environment['CHROME_EXECUTABLE']}',
],
Expand Down
10 changes: 5 additions & 5 deletions script/tool/test/dart_test_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void main() {
orderedEquals(<ProcessCall>[
ProcessCall(
getFlutterCommand(mockPlatform),
const <String>['test', '--color', '--platform=chrome'],
const <String>['test', '--color', '--platform=chrome', '--web-renderer=html'],
package.path),
]),
);
Expand All @@ -289,7 +289,7 @@ void main() {
orderedEquals(<ProcessCall>[
ProcessCall(
getFlutterCommand(mockPlatform),
const <String>['test', '--color', '--platform=chrome'],
const <String>['test', '--color', '--platform=chrome', '--web-renderer=html'],
plugin.path),
]),
);
Expand All @@ -314,7 +314,7 @@ void main() {
orderedEquals(<ProcessCall>[
ProcessCall(
getFlutterCommand(mockPlatform),
const <String>['test', '--color', '--platform=chrome'],
const <String>['test', '--color', '--platform=chrome', '--web-renderer=html'],
plugin.path),
]),
);
Expand All @@ -339,7 +339,7 @@ void main() {
orderedEquals(<ProcessCall>[
ProcessCall(
getFlutterCommand(mockPlatform),
const <String>['test', '--color', '--platform=chrome'],
const <String>['test', '--color', '--platform=chrome', '--web-renderer=html'],
plugin.path),
]),
);
Expand Down Expand Up @@ -409,7 +409,7 @@ void main() {
orderedEquals(<ProcessCall>[
ProcessCall(
getFlutterCommand(mockPlatform),
const <String>['test', '--color', '--platform=chrome'],
const <String>['test', '--color', '--platform=chrome', '--web-renderer=html'],
plugin.path),
]),
);
Expand Down
7 changes: 7 additions & 0 deletions script/tool/test/drive_examples_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--driver',
'test_driver/integration_test.dart',
'--target',
Expand Down Expand Up @@ -726,6 +727,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--driver',
'test_driver/integration_test.dart',
'--target',
Expand Down Expand Up @@ -777,6 +779,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--chrome-binary=/path/to/chrome',
'--driver',
'test_driver/integration_test.dart',
Expand Down Expand Up @@ -1223,6 +1226,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--driver',
'test_driver/integration_test.dart',
'--target',
Expand All @@ -1237,6 +1241,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--driver',
'test_driver/integration_test.dart',
'--target',
Expand Down Expand Up @@ -1334,6 +1339,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--driver',
'test_driver/integration_test.dart',
'--target',
Expand Down Expand Up @@ -1413,6 +1419,7 @@ void main() {
'web-server',
'--web-port=7357',
'--browser-name=chrome',
'--web-renderer=html',
'--driver',
'test_driver/integration_test.dart',
'--target',
Expand Down