-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[flutter_plugin_tool] Add support for running Windows unit tests #4276
Conversation
Implements support for `--windows` in `native-test`, for unit tests only. This runs the recently-added `url_launcher_windows` unit test. However, it's not yet run in CI since it needs LUCI bringup (new recipe, new builder, etc.), which will be done one this support is in place. Part of flutter/flutter#82445
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
||
final File testBinary = pluginDirectory | ||
.childDirectory('example') | ||
.childFile(testBinaryRelativePath.split('/').join(r'\')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and below: Does createFakePlugin
not handle Windows paths with backslashes? It's only one more character with a raw string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It explicitly takes Posix-style paths, so that test authors don't have to think about whether they are writing a Windows or non-Windows test when specifying extra files. This is an annoying side effect of that though, so maybe I should reconsider that. I'll take a look on Monday.
(I really wish there were a version of childFile
that took an array; I may just write that as a helper instead, as I've wanted it before. The fact that childFile
accepts something that's not actually a basename is a bit sketchy.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added that helper, and cleaned up this and a couple of places where I had been working around not having it by doing split/join dances.
* master: (490 commits) Allow neutral conclusion in publishing check (flutter#4321) Revert "[image_picker] add forceFullMetadata to interface" (flutter#4314) [image_picker] add forceFullMetadata to interface (flutter#4288) [flutter_plugin_tools] Adjust diff logging (flutter#4312) Remove gradle.properties from plugins (flutter#4309) build-examples .pluginToolsConfig.yaml support (flutter#4305) [camera_web] Make plugin publishable for the first time. (flutter#4304) adds option to re-authenticate on google silent sign in (flutter#4251) [ci.yaml] Add builders to recipes cq (flutter#4306) Add scripts for Windows LUCI recipe (flutter#4303) [video_player] Ensure seekTo is not called before video player is initialized. (flutter#4300) Ensure setExposureOffset returns new value on Android (flutter#4301) Add a way to opt a file out of Dart formatting (flutter#4292) [flutter_plugin_tools] Add Linux support to native-test (flutter#4294) [image_picker]Android update cache (flutter#4124) [flutter_plugin_tools] Fix build-examples for packages (flutter#4248) [flutter_plugin_tool] Migrate 'publish' to new base command (flutter#4290) [flutter_plugin_tool] Move branch-switching logic from tool_runner.sh to tool (flutter#4268) [flutter_plugin_tool] Add support for running Windows unit tests (flutter#4276) [camera_web] Do not flip the video on the back camera (flutter#4281) ... # Conflicts: # packages/webview_flutter/webview_flutter/CHANGELOG.md # packages/webview_flutter/webview_flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java # packages/webview_flutter/webview_flutter/pubspec.yaml
…tter#4276) Implements support for `--windows` in `native-test`, for unit tests only. The structure of the new code has most of the new functionality in a generic utility for running GoogleTest test binaries, so that it can be trivially extended to Linux support in a follow-up once the Linux test PoC has landed. This runs the recently-added `url_launcher_windows` unit test. However, it's not yet run in CI since it needs LUCI bringup; that will be done one this support is in place. Requires new logic to check if a plugin contains native code, and some new test utility plumbing to generate plugins whose pubspecs indicate that they only contain Dart code to test it, to allow filtering filtering out the FFI-based Windows plugins. Part of flutter/flutter#82445
…tter#4276) Implements support for `--windows` in `native-test`, for unit tests only. The structure of the new code has most of the new functionality in a generic utility for running GoogleTest test binaries, so that it can be trivially extended to Linux support in a follow-up once the Linux test PoC has landed. This runs the recently-added `url_launcher_windows` unit test. However, it's not yet run in CI since it needs LUCI bringup; that will be done one this support is in place. Requires new logic to check if a plugin contains native code, and some new test utility plumbing to generate plugins whose pubspecs indicate that they only contain Dart code to test it, to allow filtering filtering out the FFI-based Windows plugins. Part of flutter/flutter#82445
Implements support for
--windows
innative-test
, for unit tests only. The structure of the new code has most of the new functionality in a generic utility for running GoogleTest test binaries, so that it can be trivially extended to Linux support in a follow-up once the Linux test PoC has landed.This runs the recently-added
url_launcher_windows
unit test. However, it's not yet run in CI since it needs LUCI bringup; that will be done one this support is in place.Requires new logic to check if a plugin contains native code, and some new test utility plumbing to generate plugins whose pubspecs indicate that they only contain Dart code to test it, to allow filtering filtering out the FFI-based Windows plugins.
Part of flutter/flutter#82445
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).