Skip to content
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

☂️ Help us Kotlin-ify React Native tests #37708

Closed
30 tasks done
mdvacca opened this issue Jun 5, 2023 · 43 comments
Closed
30 tasks done

☂️ Help us Kotlin-ify React Native tests #37708

mdvacca opened this issue Jun 5, 2023 · 43 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo

Comments

@mdvacca
Copy link
Contributor

mdvacca commented Jun 5, 2023

Description

Hey all 👋
We're looking for some community support to help us prepare the codebase of React Native Android to be ready to migrate to Kotlin. In this first stage we are looking for help to migrate tests to Kotlin

How to migrate a test

If you wish to convert one of the tests you should:

  • Verify that the test is not claimed yet.
  • Comment here that you claim a test.
  • Start working on adding Kotlin support for the test.
    • Make sure your environment is set up correctly (see below)
    • Use this PR as inspiration: Convert RootViewTest to Kotlin - #37227
    • Make sure the test run correctly (see below).
    • Your Kotlin code should be formatted with ktfmt (see below).
  • Send the PR for review. Ping @cortinico and @mdvacca for a review.

Setting up your environment

Make sure your environment is set correctly, specifically you need to:

  1. Fork react-native
  2. Clone react-native locally
  3. Run yarn inside your local fork (installation instruction for yarn are here)
  4. Make sure you have Java 11 installed and the Android SDK configured (you can follow our official guide here)

Running your tests

You can run your tests either by using the Android Studio/IntelliJ UI or by invoking the following command in your React Native fork:

./gradlew :packages:react-native:ReactAndroid:test

Code formatting

Please use KtFmt to format Kotlin tests.
You can use the web UI to reformat directly from the browser:
https://facebook.github.io/ktfmt/

List of tests to migrate

@facebook facebook deleted a comment from github-actions bot Jun 6, 2023
@cortinico cortinico added ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo and removed Needs: Author Feedback Needs: Version Info labels Jun 6, 2023
@cortinico cortinico pinned this issue Jun 6, 2023
@cortinico cortinico added Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. labels Jun 6, 2023
@ankit-tailor
Copy link
Contributor

Hey @cortinico, Please assign me react/animated/NativeAnimatedNodeTraversalTest.java.

@cortinico
Copy link
Contributor

Hey @cortinico, Please assign me react/animated/NativeAnimatedNodeTraversalTest.java.

Done 👍

@okwasniewski
Copy link
Contributor

Hey @cortinico, you can assign me to react/modules/deviceinfo/DeviceInfoModuleTest.java

@hurali97
Copy link
Collaborator

hurali97 commented Jun 6, 2023

Hey @cortinico , can you assign me react/modules/clipboard/ClipboardModuleTest.java ?

@MohamedRejeb
Copy link
Contributor

MohamedRejeb commented Jun 6, 2023

Hey @cortinico , can you assign me react/fabric/events/TouchEventDispatchTest.java

@fabioh8010
Copy link
Contributor

Hey @cortinico, can you assign me to this one react/animated/NativeAnimatedInterpolationTest.java?

@aymane-missouri-nw
Copy link
Contributor

hey @cortinico , can you assign me to this one react/util/JSStackTraceTest.java

@rozkminiacz
Copy link
Contributor

@TheMissouri
Copy link

Hey @cortinico , can you assign me to this one react/modules/network/HeaderUtilTest.java

@siddarthkay
Copy link
Contributor

siddarthkay commented Jun 6, 2023

Hey @cortinico , I'd like to take this one /react/modules/share/ShareModuleTest.java
please assign it to me

@mateusz1913
Copy link
Contributor

Hey @cortinico, assign me to react/modules/blob/BlobModuleTest.java

@tarunrajput
Copy link
Contributor

Hi @cortinico, I'd like to work on this one : react/fabric/interop/FakeEventDispatcher.java

@pk-218
Copy link
Contributor

pk-218 commented Jun 6, 2023

Hi @cortinico, can you assign react/modules/network/ReactCookieJarContainerTest.java to me?

@megatunger
Copy link
Contributor

Hi @cortinico, can you assign this one to me? react/modules/camera/ImageStoreManagerTest.java

@cortinico
Copy link
Contributor

Awesome stuff, I've assigned all the tasks that got claimed so far. Folks that got a test class assigned, can start working on it.

@RyanGst
Copy link
Contributor

RyanGst commented Jun 6, 2023

hey @cortinico, can you assign this one to me? react/modules/network/ProgressiveStringDecoderTest.java

@fathonyfath
Copy link
Contributor

hey @cortinico , could you assign me this one react/modules/dialog/DialogModuleTest.java

I'll try to help as much as possible :)

@jasokolowska
Copy link

Hey @cortinico, please assign me react/fabric/interop/InteropEventEmitterTest.java

facebook-github-bot pushed a commit that referenced this issue Jun 9, 2023
Summary:
This PR converts DialogModuleTest into Kotlin as requested in [this issue](#37708).

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [CHANGED] - Convert DialogModuleTest to Kotlin

Pull Request resolved: #37795

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.

Reviewed By: cortinico

Differential Revision: D46596235

Pulled By: mdvacca

fbshipit-source-id: ef4184664ad885ebd2e8c1d51ca5bb7dc48f0610
facebook-github-bot pushed a commit that referenced this issue Jun 12, 2023
Summary:
This PR converts DeviceInfoModuleTest into Kotlin as requested in #37708.

## Changelog:

[INTERNAL] [CHANGED] - Convert DeviceInfoModuleTest to Kotlin

Pull Request resolved: #37805

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.

Reviewed By: cortinico

Differential Revision: D46614375

Pulled By: rshest

fbshipit-source-id: 3fc390069628e3ce188121f3e775b28e88875af8
facebook-github-bot pushed a commit that referenced this issue Jun 13, 2023
Summary:
This PR converts HeaderUtilTest.java to Kotlin as requested in #37708.

## Changelog:

[INTERNAL] [CHANGED] - Convert HeaderUtilTest to Kotlin

Pull Request resolved: #37829

Test Plan:
Run ./gradlew :packages:react-native:ReactAndroid:test.
All tests should pass.

Reviewed By: mdvacca

Differential Revision: D46647152

Pulled By: cortinico

fbshipit-source-id: a05108c4cae28526ac55f4f273673221e3ff4cf1
facebook-github-bot pushed a commit that referenced this issue Jun 14, 2023
Summary:
Part of #37708

## Changelog:
[Internal] [Changed] - Convert JavaOnlyArrayTest to Kotlin

Pull Request resolved: #37855

Reviewed By: cortinico

Differential Revision: D46697501

Pulled By: rshest

fbshipit-source-id: edc3906c41af4936eacdeb95502cc62f80ae89c8
facebook-github-bot pushed a commit that referenced this issue Jun 16, 2023
Summary:
This PR migrates ReactCookieJarContainerTest.java to Kotlin as a part of the issue #37708

## Changelog:
[INTERNAL] [CHANGED] - Migrate ReactCookieJarContainerTest.java to Kotlin

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: #37809

Test Plan:
1. Run ./gradlew :packages:react-native:ReactAndroid:test.
2. All tests should pass.

Reviewed By: javache

Differential Revision: D46779169

Pulled By: rshest

fbshipit-source-id: b5caa9397ac1b852fc73d9c58afc4a21caeb8727
facebook-github-bot pushed a commit that referenced this issue Jun 19, 2023
Summary:
This PR converts [NativeAnimatedNodeTraversalTest](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java) into Kotlin as requested in #37708

## Changelog:
[INTERNAL] [CHANGED] - Convert `NativeAnimatedNodeTraversalTest` to Kotlin

Pull Request resolved: #37960

Test Plan:
1. Run `./gradlew :packages:react-native:ReactAndroid:test`.
2. All tests should pass.

Reviewed By: javache

Differential Revision: D46838215

Pulled By: rshest

fbshipit-source-id: 6681d74896a0c94fa7f3ad2ce79eeab4974c55f4
@stanwolverine
Copy link
Contributor

@mdvacca Any pending test for me?

@mdvacca
Copy link
Contributor Author

mdvacca commented Jun 22, 2023

@stanwolverine, let me review the list and I will get back to you

@ankit-tailor
Copy link
Contributor

Hey @mdvacca, NativeAnimatedNodeTraversalTest is already migrated.

@mdvacca
Copy link
Contributor Author

mdvacca commented Jun 22, 2023

@mdvacca
Copy link
Contributor Author

mdvacca commented Jun 23, 2023

@stanwolverine
Copy link
Contributor

@mdvacca thanks, I will start working

@rupam-seal
Copy link

@mdvacca, do you have any test for me?

@cortinico
Copy link
Contributor

@mdvacca, do you have any test for me?

Currently all the tests are assigned. If @stanwolverine doesn't send both PRs by the end of tomorrow, we can assign those tests to you @rupam-seal

@rupam-seal
Copy link

Ok Thank you!🫡

@stanwolverine
Copy link
Contributor

Hey @cortinico and @rupam-seal , After solving many issues while setting up react-native on my local machine, I was able to finish both tests. I will send both PRs before the end of tomorrow.

facebook-github-bot pushed a commit that referenced this issue Jul 1, 2023
Summary:
Helping in [Kotlin-ify React Native tests](#37708), Converted [react/fabric/interop/InteropEventEmitterTest.java](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/InteropEventEmitterTest.java) to kotlin file

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [CHANGED] - `InteropEventEmitterTest.java` file migrated from java to kotlin

Pull Request resolved: #38144

Test Plan:
Tests should pass
```
./gradlew :packages:react-native:ReactAndroid:test
```

Reviewed By: NickGerleman

Differential Revision: D47165007

Pulled By: mdvacca

fbshipit-source-id: 459b0867810eb1b782eea354d74152306b9546ff
facebook-github-bot pushed a commit that referenced this issue Jul 3, 2023
Summary:
Helping in [Kotlin-ify React Native tests](#37708), Converted [react/bridge/JavaScriptModuleRegistryTest.java](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaScriptModuleRegistryTest.java) to kotlin file

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [CHANGED] - `JavaScriptModuleRegistryTest.java` file migrated from java to kotlin

Pull Request resolved: #38143

Test Plan:
Tests should pass
```
./gradlew :packages:react-native:ReactAndroid:test
```

Reviewed By: NickGerleman

Differential Revision: D47164993

Pulled By: mdvacca

fbshipit-source-id: 6aee2bcb2766fc2e6d68f4df272aaafb9c65bdcb
@mdvacca
Copy link
Contributor Author

mdvacca commented Jul 3, 2023

Thanks everyone for contributing to migrate React Native Android tests to Kotlin

Since all the tests on the list were migrated, I'm closing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo
Projects
None yet
Development

No branches or pull requests