-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pigeon] replaced all_datatype compilation tests with platform unit tests #373
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] replaced all_datatype compilation tests with platform unit tests #373
Conversation
a928e24 to
47636d4
Compare
|
@stuartmorgan Looks like we've added a license check to CI. What do we want to do about generated code? Add an exception? Make Pigeon generate a custom header? It seems like we want the warning about being autogenerated on top even if we add a copyright. Here's the error: |
When I fixed everything in order to land the license check I just manually added it to the Pigeon files, under the theory that re-generating them is not likely to be something we do frequently so it wouldn't be a problem to just do that again next time.
No, the guidance we have received is that all code we check in should have a license block.
Having Pigeon generate a header would work as well. Presumably that would be something like an optional file path containing the content to put at the top of each file.
Maybe? Usually warnings like that are in files that are auto-generated as part of a build system (meaning changes will either always be destroyed, or be unpredictably destroyed, depending on the details), which isn't the case with Pigeon. I'm not against it being there, but given that it requires manual generation I'm not sure there's really much argument against someone editing them; yes, they could stomp their changes the next time the manually re-generate the file, but that seems pretty obviously what would happen. Edit Oh, you mean at the very top. No, the license block should always be before any file comments. |
2bf89b2 to
cdf3827
Compare
...id_unit_tests/android/app/src/test/java/com/example/android_unit_tests/AllDatatypesTest.java
Outdated
Show resolved
Hide resolved
packages/pigeon/platform_tests/flutter_null_safe_unit_tests/test/all_datatypes_test.dart
Outdated
Show resolved
Hide resolved
packages/pigeon/run_tests.sh
Outdated
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.
Not for this PR, but it would be useful to look into whether the native unit tests could be using flutter_plugin_tools, which has pretty similar logic for running native unit tests for plugins.
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.
The code LG, but are the Android unit tests actually running in CI? I looked at the output, and I see output from the ObjC tests, but couldn't find anything that looked like output from the Java unit tests. Maybe I just missed it, but it seems worth verifying.
Yep, CI is executing "run_tests.sh", the same thing I use when developing. |
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.
LGTM modulo looking at the CI output to make sure you are seeing the Android test results.
Sorry for the delay, I thought you were going to update this to split apart the tests in Cirrus, but maybe you meant that to be a follow-up.
|
The output from the tests is a common complaint. I tried the options suggested in this SO question. The -i seemed to print out tons of worthless info and the afterTest closures didn't seem to print out anything: diff --git a/packages/pigeon/platform_tests/android_unit_tests/android/app/build.gradle b/packages/pigeon/platform_tests/android_unit_tests/android/app/build.gradle
index f45bc0b..204eb22 100644
--- a/packages/pigeon/platform_tests/android_unit_tests/android/app/build.gradle
+++ b/packages/pigeon/platform_tests/android_unit_tests/android/app/build.gradle
@@ -51,6 +51,11 @@ android {
testOptions {
unitTests.returnDefaultValues = true
+ unitTests.all {
+ afterTest { descriptor, result ->
+ println "Executing test for ${descriptor.name} with result: ${result.resultType}"
+ }
+ }
}
} |
d5f1389 to
6bd6639
Compare
Yep, thanks for the reminder on that too. |
Bumps [cider](https://github.com/f3ath/cider) from 0.1.3 to 0.1.5. - [Release notes](https://github.com/f3ath/cider/releases) - [Changelog](https://github.com/f3ath/cider/blob/master/CHANGELOG.md) - [Commits](f3ath/cider@0.1.3...0.1.5) --- updated-dependencies: - dependency-name: cider dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
issue: flutter/flutter#84155
Pre-launch Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy.CHANGELOG.mdto add a description of the change.///).If you need help, consider asking for advice on the
#hackers-newchannel on Discord.