facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.05k stars 24.19k forks source link

β˜‚οΈ Help us migrate Android tests to AssertJ #45596

Closed cortinico closed 1 month ago

cortinico commented 1 month ago

Hey all πŸ‘‹ We'd like to use the community some support to help us migrate our to AssertJ (https://assertj.github.io/doc/#assertj-core).

We prepared a list of files that should be migrated from JUnit's Asserts (i.e. import org.junit.Assert...) from AssertJ (i.e. import org.assertj...).

AssertJ is a more powerful assertion library which makes it immediately clear where the test failure is.

How to work

The recommended number of files to migrate together is 3-5

If you wish to migrate some of the files you should:

You can't claim more than 5 files at a time.

How to migrate a test

You can see an example of a test migration in this commit: https://github.com/facebook/react-native/commit/91ecd7eb5330f5d725f5587744713064d614a6b3

You can read the guide here: https://assertj.github.io/doc/#assertj-core-assertions-guide on how to migrate a test from JUnit's assertion to AssertJ

List of files to migrate

How to test

Make sure the test is running correctly after you migrated it.

You can test it as follows:

  1. For tests inside packages/react-native/ with the command:

    ./gradlew test
  2. For tests inside packages/gradle-plugin/ with the command:

    ./gradlew -p packages/gradle-plugin test
migueldaipre commented 1 month ago

Hey @cortinico ,

Please assign me TaskUtilsTest.kt, JsonUtilsTest.kt and OsTest.kt

kachmashk commented 1 month ago

Hey! I'll be taking next 5 after @migueldaipre

cortinico commented 1 month ago

@migueldaipre @kachmashk done. Also @kachmashk I've assigned only 5 to leave some for others to do as well, you can claim more once you're done with yours.

kachmashk commented 1 month ago

Sure thing @cortinico, will change my comment one last time to remove the sixth one.

retyui commented 1 month ago

Please assign me ClipboardModuleTest.kt

henriquecicero commented 1 month ago

Hey, @cortinico.

I would like to take FileUtilsTest.kt, NdkConfiguratorUtilsTest.kt and AgpConfiguratorUtilsTest.kt, please.

bionanek commented 1 month ago

hey there! I can take care of packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareBoostTaskTest.kt

bufgix commented 1 month ago

Hey πŸ‘‹ i would like to take packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.kt. Thank you

gustavoabel commented 1 month ago

Hey @cortinico, please assign me BackwardCompatUtilsTest.kt

migueldaipre commented 1 month ago

Hey @cortinico. I'd like to migrate 3 more files.

gustavoabel commented 1 month ago

Hey @cortinico, I would like to migrate these too:

Skipperlla commented 1 month ago

Hey πŸ‘‹ i would like to take packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/internal/interop/InteropUiBlockListenerTest.kt. Thank you

omerayhan-shft commented 1 month ago

Hey @cortinico πŸ‘‹ i would like to take packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GeneratePackageListTaskTest.kt. Thank you

Tony-MK commented 1 month ago

Hey @cortinico , can assign me for the following:

GeneratePackageListTaskTest.kt

GenerateCodegenArtifactsTaskTest.kt

Thanks

omer-ayhan commented 1 month ago

Hey @cortinico πŸ‘‹ i would like to take packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PreparePrefabHeadersTaskTest.kt. Thank you

omer-ayhan commented 1 month ago

Hey @cortinico πŸ‘‹ i would like to take packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTaskTest.kt. Thank you

BogiKay commented 1 month ago

Hey @cortinico, please assign me to packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/internal/PrepareJSCTaskTest.kt

yakupozbaydar commented 1 month ago

Hey @cortinico , I would like to migrate packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.kt Thank you πŸ‘‹

barbarosaffan commented 1 month ago

Hey @cortinico I can migrate packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/ReactExtensionTest.kt if possible, thank you

omer-ayhan commented 1 month ago

if possible I can also take packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/BundleHermesCTaskTest.kt migration task as well @cortinico

migueldaipre commented 1 month ago

Hey @cortinico. I can migrate

if possible, thanks! πŸ‘‹

jaworek commented 1 month ago

Hey @cortinico , I'll take:

migueldaipre commented 1 month ago

Hey @cortinico. I would like to take the last one available.

ShareModuleTest.kt

cortinico commented 1 month ago

Thank you all for the great work so far! We're 75% done that's huge πŸŽ‰

To everyone still having an open test, please try to conclude it this week πŸ‘

@barbarosaffan your assigned file ReactExtensionTest.kt was already migrated as part of another refactoring needed for 0.75, so there is no work for you to do :)

cortinico commented 1 month ago

Ping to @BogiKay and @Tony-MK as yours are the last 2 files. If you can't migrate them, please answer by EOD or we'll release it for the next contributor to pickup πŸ‘

BogiKay commented 1 month ago

Ping to @BogiKay and @Tony-MK as yours are the last 2 files. If you can't migrate them, please answer by EOD or we'll release it for the next contributor to pickup πŸ‘

Hey, I'm planning to raise a PR by EOD.

omer-ayhan commented 1 month ago

I am also planning to finish my PR by EOD as well @cortinico

Tony-MK commented 1 month ago

Ping to @BogiKay and @Tony-MK as yours are the last 2 files. If you can't migrate them, please answer by EOD or we'll release it for the next contributor to pickup πŸ‘

Hey, I'm planning to raise a PR by EOD.

cortinico commented 1 month ago

Thank you all for helping us with this migration! Your contribution was extremely valuable to keep our tests clean and tidy! I hope you enjoyed contributing to React Native.

gustavoabel commented 1 month ago

@cortinico Thank you for the opportunity, I hope to have more chances to contribute to this amazing project.