Skip to content

iceberg-spark: Switch tests to JUnit5 + AssertJ-style assertions #9086

Closed

Description

@nastra

Feature Request / Improvement

The goal is to switch all imports to JUnit5 imports and to use AssertJ-style assertions

depends on #9074 #9075 #9076

Query engine

Spark

Activity

  1. added
    good first issue
    beginner
    on Nov 15, 2023
  2. chinmay-bhat commented on Dec 10, 2023

    @chinmay-bhat
    Contributor

    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?

  3. nastra commented on Dec 11, 2023

    @nastra
    ContributorAuthor

    For parameterized testing we would need to have #9210 implemented first.

  4. chinmay-bhat commented on Dec 11, 2023

    @chinmay-bhat
    Contributor

    Ok, so can I pick this up once the parameterized tests PR is merged?

    Also, iceberg-spark has folders for each version (v3.2, 3.3, 3.4, 3.5). Do you recommend creating separate PRs for each?

  5. nastra commented on Dec 11, 2023

    @nastra
    ContributorAuthor

    We should be mostly focusing on migrating Spark 3.5, which is already a big task

  6. chinmay-bhat commented on Dec 11, 2023

    @chinmay-bhat
    Contributor

    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 :)

  7. chinmay-bhat commented on Jan 16, 2024

    @chinmay-bhat
    Contributor

    can we mark this is as done?

  8. nastra commented on Jan 16, 2024

    @nastra
    ContributorAuthor

    @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

  9. chinmay-bhat commented on Jan 16, 2024

    @chinmay-bhat
    Contributor

    I'll raise PRs for the remaining migrations in the coming days.

  10. tomtongue commented on Jan 31, 2024

    @tomtongue
    Contributor

    @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?

  11. nastra commented on Jan 31, 2024

    @nastra
    ContributorAuthor

    @tomtongue yes that would be great if you could do that

  12. tomtongue commented on Jan 31, 2024

    @tomtongue
    Contributor

    @nastra Thanks so much. I'm working on it now, will submit a CR today (sorry, tomorrow) .

  13. tomtongue commented on Feb 27, 2024

    @tomtongue
    Contributor

    @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?

  14. nastra commented on Feb 27, 2024

    @nastra
    ContributorAuthor

    @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.

  15. tomtongue commented on Feb 27, 2024

    @tomtongue
    Contributor

    @nastra Thanks for checking. I found the following classes still have the old version. Let me fix them 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.

  16. nastra commented on Feb 27, 2024

    @nastra
    ContributorAuthor

    We can also remove SparkTestBase and all of its subclasses, since those have all been migrated to JUnit5 now

  17. tomtongue commented on Feb 27, 2024

    @tomtongue
    Contributor

    Sure, will remove them once I confirm the removal is no problem.

  18. tomtongue commented on Feb 28, 2024

    @tomtongue
    Contributor

    @nastra I believe all the classes have been migrated to JUnit5. Is there remaining actions for the migration?

  19. nastra commented on Feb 28, 2024

    @nastra
    ContributorAuthor

    Closing this as all of the Spark 3.5 tests have been migrated to JUnit5 + AssertJ. Thanks everyone for helping out and contributing

  20. tomtongue commented on Feb 28, 2024

    @tomtongue
    Contributor

    Thanks for your reviews too! Appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    beginnergood first issue

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions