You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iceberg-spark: Switch tests to JUnit5 + AssertJ-style assertions #9086
As it's a big task, I'll get started migrating tests in iceberg-spark v3.5 that are not parameterized, and later open a new PR for the parameterized ones :)
@chinmay-bhat I don't think this is complete yet. There are still plenty of places that use org.junit.Test and @RunWith(Parameterized.class) within the iceberg-spark module
@nastra It seems that the SparkExtensionTestBase class and some of the related extension modules in this path are still using JUnit 4 and non-AssertJ. I'm working on the modules migration, may I create a PR for this?
@nastra I believe all of the spark 3.5 classes were migrated to JUnit 5. Is there any remaining actions to close this issue? Do we migrate other versions of Spark as well?
There are also two classes that have org.junit.Assert but they were already migrated to JUnit5 as the different class names like TestBase and TestBaseWithCatalog. I believe they are not necessary to be updated.
Activity
chinmay-bhat commentedon Dec 10, 2023
Hi @nastra, can I be assigned to this? Looks like the dependent issues have been resolved/merged.
Also I've read through the discussion on #7160. Is there any other dependency / resource I need to read before beginning?
nastra commentedon Dec 11, 2023
For parameterized testing we would need to have #9210 implemented first.
chinmay-bhat commentedon Dec 11, 2023
Ok, so can I pick this up once the parameterized tests PR is merged?
Also,
iceberg-sparkhas folders for each version (v3.2, 3.3, 3.4, 3.5). Do you recommend creating separate PRs for each?nastra commentedon Dec 11, 2023
We should be mostly focusing on migrating Spark 3.5, which is already a big task
chinmay-bhat commentedon Dec 11, 2023
As it's a big task, I'll get started migrating tests in
iceberg-sparkv3.5 that are not parameterized, and later open a new PR for the parameterized ones :)chinmay-bhat commentedon Jan 16, 2024
can we mark this is as done?
nastra commentedon Jan 16, 2024
@chinmay-bhat I don't think this is complete yet. There are still plenty of places that use
org.junit.Testand@RunWith(Parameterized.class)within theiceberg-sparkmodulechinmay-bhat commentedon Jan 16, 2024
I'll raise PRs for the remaining migrations in the coming days.
tomtongue commentedon Jan 31, 2024
@nastra It seems that the SparkExtensionTestBase class and some of the related extension modules in this path are still using JUnit 4 and non-AssertJ. I'm working on the modules migration, may I create a PR for this?
nastra commentedon Jan 31, 2024
@tomtongue yes that would be great if you could do that
tomtongue commentedon Jan 31, 2024
@nastra Thanks so much. I'm working on it now, will submit a CR
today(sorry, tomorrow) .tomtongue commentedon Feb 27, 2024
@nastra I believe all of the spark 3.5 classes were migrated to JUnit 5. Is there any remaining actions to close this issue? Do we migrate other versions of Spark as well?
nastra commentedon Feb 27, 2024
@tomtongue It appears that there are still some references left to
org.junit.[Test|Assert|Assume]in Spark 3.5 that we should fix as well.tomtongue commentedon Feb 27, 2024
@nastra Thanks for checking. I found the following classes still have the old version. Let me fix them as well
iceberg/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkMetadataColumns.java
Line 62 in 8a16a41
iceberg/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/functions/TestSparkFunctions.java
Line 26 in 8a16a41
There are also two classes that have
org.junit.Assertbut they were already migrated to JUnit5 as the different class names likeTestBaseandTestBaseWithCatalog. I believe they are not necessary to be updated.iceberg/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/SparkTestBase.java
Line 57 in 8a16a41
iceberg/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/SparkTestBaseWithCatalog.java
Line 36 in 8a16a41
nastra commentedon Feb 27, 2024
We can also remove
SparkTestBaseand all of its subclasses, since those have all been migrated to JUnit5 nowtomtongue commentedon Feb 27, 2024
Sure, will remove them once I confirm the removal is no problem.
tomtongue commentedon Feb 28, 2024
@nastra I believe all the classes have been migrated to JUnit5. Is there remaining actions for the migration?
nastra commentedon Feb 28, 2024
Closing this as all of the Spark 3.5 tests have been migrated to JUnit5 + AssertJ. Thanks everyone for helping out and contributing
tomtongue commentedon Feb 28, 2024
Thanks for your reviews too! Appreciate it.