-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[flutter_plugin_tools] Add Linux support to native-test #4294
[flutter_plugin_tools] Add Linux support to native-test #4294
Conversation
Hrm, I'll need to debug why it's not finding the tests when running in CI tomorrow; it worked for me locally. |
This is fixed now; |
// Handles the canLaunch method call. | ||
// | ||
// Temporarily exposed for testing due to | ||
// https://github.com/flutter/flutter/issues/88724 |
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.
Nit consider phrasing as a TODO to aid in tech-debt greppability.
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.
Good point, done.
// same tests multiple times. | ||
// Only run the release build of the unit tests, to avoid running the | ||
// same tests multiple times. Release is used rather than debug since | ||
// `build-examples` builds release versions. |
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.
Was going to say perhaps we should be changing to generate a debug build of build-examples given that it's typically more convenient to debug debug builds. That said, in the end you want to verify the release build of the library code in the plugin, and people shouldn't be relying on #ifdef
'ed code in their tests, so this seems fine.
If this ever gets problematic, we could add a buildmode flag.
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 just realized that there's actually a more annoying problem, which is that the current behavior isn't going to be good for local use. Filed flutter/flutter#89303.
I'm going to do that as a follow-up since it applies to the already-landed Windows flow in the same way, but I'll do it shortly.
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
- Adds a minimal unit test to url_launcher_linux as a proof of concept. This uses almost exactly the same CMake structure as the Windows version that was added recently. - Adds Linux support for unit tests to `native-test`, sharing almost all of the existing Windows codepath. - Fixes the fact that it it was running the debug version of the unit tests, but `build-examples` only builds release. (On other platforms we run debug unit tests, but on those platforms the test command internally builds the requested unit tests, so the mismatch doesn't matter.) - Enables the new test in CI. Also opportunistically fixes some documentation in `native_test_command.dart` that wasn't updated as more platform support was added. Linux portion of flutter/flutter#82445
- Adds a minimal unit test to url_launcher_linux as a proof of concept. This uses almost exactly the same CMake structure as the Windows version that was added recently. - Adds Linux support for unit tests to `native-test`, sharing almost all of the existing Windows codepath. - Fixes the fact that it it was running the debug version of the unit tests, but `build-examples` only builds release. (On other platforms we run debug unit tests, but on those platforms the test command internally builds the requested unit tests, so the mismatch doesn't matter.) - Enables the new test in CI. Also opportunistically fixes some documentation in `native_test_command.dart` that wasn't updated as more platform support was added. Linux portion of flutter/flutter#82445
native-test
, sharing almost all of the existing Windows codepath.build-examples
only builds release. (On other platforms we run debug unit tests, but on those platforms the test command internally builds the requested unit tests, so the mismatch doesn't matter.)Also opportunistically fixes some documentation in
native_test_command.dart
that wasn't updated as more platform support was added.Linux portion of flutter/flutter#82445
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).