-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[pigeon] Consolidate platform test harnesses #2803
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
[pigeon] Consolidate platform test harnesses #2803
Conversation
|
Notes for review:
If you'd like me to cut this into an initial PR for the scaffolding and then one for each language, let me know. That was my original plan, but as I went through it, it seemed like it might be easier (and faster) to review as a series of incremental commits rather than a flurry of PRs, but since the commits are already separated it would be pretty easy to change to multi-PR if you would prefer. |
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.
Will this have any impact on our ability to run platform specific tests?
Does calling Java and ObjC 'alternate' make sense when the Kotlin and Swift generators are still in experimental status?
Seems like a lot of work, thank you for doing this!
packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle
Show resolved
Hide resolved
| @@ -0,0 +1,3 @@ | |||
| ## 0.0.1 | |||
|
|
|||
| * TODO: Describe initial release. | |||
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.
Todo before this merge, or after?
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.
Oops, this is boilerplate from create; I need to delete these files.
|
Also, it appears that macos pigeon tests are failing |
stuartmorgan-g
left a comment
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.
Hmm, I thought the java 11 thing in CI was resolved a while ago. I'm have to dig into that more.
Will this have any impact on our ability to run platform specific tests?
If people are running them manually it'll be a little different, but the script is updated to include the changes.
Does calling Java and ObjC 'alternate' make sense when the Kotlin and Swift generators are still in experimental status?
There wasn't a great name for this second plugin 😐 I named it "alternate" from the perspective of plugin development, where the default languages for create are Kotlin and Swift, since that seems like the most future-proof (at some point these won't be experimental languages), but I'm definitely open to other names.
packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/build.gradle
Show resolved
Hide resolved
| @@ -0,0 +1,3 @@ | |||
| ## 0.0.1 | |||
|
|
|||
| * TODO: Describe initial release. | |||
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.
Oops, this is boilerplate from create; I need to delete these files.
packages/pigeon/platform_tests/alternate_language_test_plugin/example/lib/main.dart
Outdated
Show resolved
Hide resolved
gaaclarke
left a comment
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 gave this a read through, looking good. I'll dive more deeply after the CI steps are green. I don't want to look at it then you have to change things around to fix CI.
packages/pigeon/platform_tests/test_plugin/example/lib/main.dart
Outdated
Show resolved
Hide resolved
| @@ -298,7 +298,7 @@ run_android_unittests() { | |||
| gen_android_unittests_code ./pigeons/void_arg_host.dart VoidArgHost | |||
| gen_android_unittests_code ./pigeons/voidflutter.dart VoidFlutter | |||
| gen_android_unittests_code ./pigeons/voidhost.dart VoidHost | |||
| cd platform_tests/android_unit_tests | |||
| cd platform_tests/alternate_language_test_plugin/example | |||
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.
The idea is that we'll move to the standard plugin testing scripts at some point, not here, right? Will @tarrinneal integration tests get run here?
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.
The idea is that we'll move to the standard plugin testing scripts at some point, not here, right?
Ideally; see PR description.
Will @tarrinneal integration tests get run here?
These scaffolds will host the integration tests as well; running them will be a different step since it will use flutter drive rather than gradle.
I was thinking of our Linux images; that's where most of our Android plugin testing is done. For now I'm going to roll back the Gradle versions here to avoid the issue. Later we can either see about getting a macOS image with Java 11 (e.g., maybe moving this test to LUCI where we can adjust the images), or making the Android Pigeon tests not run on macOS in CI. |
|
I'm not sure why the macOS tests keep timing out; there's nothing helpful I can find in the logs when it's happening. From the CPU graph it looks like pretty early on something gets into a loop and just stays there forever, because the CPU stays completely pegged for the rest of the run. (Edit: And locally this whole test run takes me a little under 7 minutes, so it's not like we're close to the 1 hour bot timeout if things are working.) |
|
Since CI logs aren't helping and I can't repro locally, I think the best option is to turn this into a series of PRs and land them incrementally, to narrow down the problem. |
|
Closing in favor of #2816; all of the other pieces have now landed separately. (The problem is with moving the ObjC tests into the new harness, but I'm not sure why yet.) |
Replaces all of the individual platform test harnesses with two plugins—one for most languages, one for alternate languages (Java and Obj-C)—to consolidate everything into a multi-platform test harness that uses exactly the same structure as all of the native unit tests in flutter/plugins. This has several benefits:
run_test.*logic with the existing repo tooling that knows how to run tests that look like this (although currently not when the plugin is a sub-package).In most cases the test files moved with essentially no changes. The primary exception was macOS, which was using a completely different (Cocoapod-based) test setup, so that test was restructured.
(No changelog or version changes since these are dev-only changes, but the check doesn't know that since the structure is unusual here.)
Part of flutter/flutter#111505
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).