Skip to content

[flutter_tools] run web unit tests in sound null safety #70799

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 9 commits into from
Nov 20, 2020

Conversation

jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Nov 19, 2020

Description

Does not yet support autodetect, but allows flutter test --platform chrome to run in sound mode. does some minimal plumbing to also support canvaskit.

Fixes #70715

@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Nov 19, 2020
@google-cla google-cla bot added the cla: yes label Nov 19, 2020
@@ -44,12 +57,12 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
globals.fs.path.join(outputDirectory.path, '${relativeTestSegments.join('_')}.test.dart'));
generatedFile
..createSync(recursive: true)
..writeAsStringSync(_generateEntrypoint(relativeTestSegments.join('/'), testFilePath));
..writeAsStringSync(_generateEntrypoint(relativeTestSegments.join('/'), testFilePath, languageVersion));
generatedFiles.add(generatedFile);
}
// Generate a fake main file that imports all tests to be executed. This will force
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL this is what we do

@harryterkelsen
Copy link
Contributor

The test can be fixed by modifying some lines in packages/flutter_web_plugins/src/plugin_registry.dart:

  Future<ByteData?>? send(String channel, ByteData? message) {
    final Completer<ByteData?> completer = Completer<ByteData?>();

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonahwilliams jonahwilliams merged commit a76289b into flutter:master Nov 20, 2020
@jonahwilliams jonahwilliams deleted the allow_null_safe_web_tests branch November 20, 2020 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run flutter web unit tests in sound mode
3 participants