react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Convert BaseJavaModuleTest to Kotlin

Open abdennour-jebbar-nw opened this issue 2 years ago • 8 comments

Summary:

As part of the effort to Kotlin-fy React Native tests, I've converted BaseJavaModuleTest to Kotlin.

Changelog:

[Internal] [Changed] - Convert BaseJavaModuleTest to Kotlin

Test Plan:

Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with KtFmt

abdennour-jebbar-nw avatar Jun 11 '23 19:06 abdennour-jebbar-nw

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,744,428 -3,406
android hermes armeabi-v7a 8,056,635 -3,800
android hermes x86 9,235,558 -3,882
android hermes x86_64 9,086,375 -2,863
android jsc arm64-v8a 9,307,265 -3,164
android jsc armeabi-v7a 8,496,811 -3,552
android jsc x86 9,369,285 -3,641
android jsc x86_64 9,624,206 -2,618

Base commit: 03f70bf995379f08a77abcf96bb0e31ff75ca8c3 Branch: main

analysis-bot avatar Jun 11 '23 20:06 analysis-bot

Hello @cortinico, can you have a look at this PR?

abdennour-jebbar-nw avatar Jun 12 '23 08:06 abdennour-jebbar-nw

@abdennour-jebbar-nw

Thank you so much for taking this on!

Looks good overall, aside from a few stylistic suggestions.

rshest avatar Jun 12 '23 09:06 rshest

@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Jun 12 '23 10:06 facebook-github-bot

@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Jun 12 '23 11:06 facebook-github-bot

@cortinico I'm investigating the failing tests

abdennour-jebbar-nw avatar Jun 12 '23 14:06 abdennour-jebbar-nw

Hey @abdennour-jebbar-nw , what are your plans with the diff?

Will you be able to follow up, or should we maybe close it?

rshest avatar Jun 14 '23 22:06 rshest

@rshest I'm still following up with this PR, I'm trying to figure out why the moduleWrapper remains null

abdennour-jebbar-nw avatar Jun 15 '23 08:06 abdennour-jebbar-nw

@rshest I'm still following up with this PR, I'm trying to figure out why the moduleWrapper remains null

@abdennour-jebbar-nw

Hey, I think I know the reason why the remaining two tests were crashing, please see my code suggestions above.

Since the methods in question (and their arguments) were mocked, it's not safe to have them strictly non-nullable. This caused the crash.

rshest avatar Jun 21 '23 12:06 rshest

@rshest Thank you so much for following up with me, I'll try the changes asap, once green I'll update the PR. Your help was so much appreciated 🙌

abdennour-jebbar-nw avatar Jun 22 '23 08:06 abdennour-jebbar-nw

This pull request was successfully merged by @abdennour-jebbar-nw in 8ddb334bb08851ea7b5ed68246fcfd0bc36165c0.

When will my fix make it into a release? | Upcoming Releases

github-actions[bot] avatar Jun 22 '23 10:06 github-actions[bot]

@rshest Thank you so much for following up with me, I'll try the changes asap, once green I'll update the PR. Your help was so much appreciated 🙌

@abdennour-jebbar-nw I verified internally that the tests are fixed, so your PR is merged to trunk now. Thank you very much, once again, for working on this! :)

rshest avatar Jun 22 '23 10:06 rshest