Skip to content

Migrate TableTestBase related classes to JUnit5 and delete TableTestBase#10063

Merged
nastra merged 2 commits intoapache:mainfrom
tomtongue:mig-junit5-core-tabletestbase
Apr 2, 2024
Merged

Migrate TableTestBase related classes to JUnit5 and delete TableTestBase#10063
nastra merged 2 commits intoapache:mainfrom
tomtongue:mig-junit5-core-tabletestbase

Conversation

@tomtongue
Copy link
Contributor

@tomtongue tomtongue commented Mar 29, 2024

Migrate the following test classes to delete TableTestBase for #9085.

Current Progress

  • WriterTestBase
    • TestFileWriterFactory
      • TestGenericFileWriterFactory
      • TestSparkFileWriterFactory for the versions: v3.3, v3.4, v3.5
      • TestFlinkFileWriterFactory for the versions: v1.15, v1.16, v.1.17, v1.18
    • TestPartitioningWriters
      • TestSparkPartitioningWriters for the versions: v3.3, v3.4, v3.5
      • TestFlinkPartitioningWriters for the versions: v1.15, v1.16, v.1.17, v1.18
    • TestPositionDeltaWriters
      • TestSparkPositionDeltaWriters for the versions: v3.3, v3.4, v3.5
      • TestFlinkPositionDeltaWriters for the versions: v1.15, v1.16, v.1.17, v1.18
    • TestRollingFileWriters
      • TestSparkRollingFileWriters for the versions: v3.3, v3.4, v3.5
      • TestFlinkRollingFileWriters for the versions: v1.15, v1.16, v.1.17, v1.18

iceberg-flink for the versions: v1.15, v1.16, v.1.17, v1.18

  • TestStreamingReaderOperator
  • TestStreamingMonitorFunction
  • TestIcebergFilesCommitter
  • TestDeltaTaskWriter

@tomtongue tomtongue changed the title Migrate TableTestBase to JUnit5 and delete TableTestBase Migrate TableTestBase related classes to JUnit5 and delete TableTestBase Mar 29, 2024
@tomtongue tomtongue changed the title Migrate TableTestBase related classes to JUnit5 and delete TableTestBase [WIP] Migrate TableTestBase related classes to JUnit5 and delete TableTestBase Mar 29, 2024
@tomtongue tomtongue force-pushed the mig-junit5-core-tabletestbase branch from 3a3470e to e0ef61c Compare March 30, 2024 15:37
@tomtongue tomtongue changed the title [WIP] Migrate TableTestBase related classes to JUnit5 and delete TableTestBase Migrate TableTestBase related classes to JUnit5 and delete TableTestBase Mar 30, 2024
@tomtongue
Copy link
Contributor Author

@nastra Migrate all classes related to TableTestBase. Could you review?

import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.util.StructLikeSet;
import org.junit.Assert;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a JUnit4-Assert left here

Copy link
Contributor Author

@tomtongue tomtongue Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nastra Thanks for the review. This time, I only migrate classes related to TableTestBase to delete the class, so I keep these classes JUnit4 because there should be a lot of changes if each class is updated to JUnit5. And, I'm thinking that after deleting TableTestBase, I'll migrate those classes to Junit 5. Should I update all classes in this PR to JUnit 5? or partially update?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah indeed, that would lead to many changes. I'm ok doing the conversion from JUnit4 asserts to AssertJ on these files in a separate PR then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I'll create a PR to migrate them in a separate PR. At least, through this issue, we can delete the TableTestBase.

@@ -35,33 +40,27 @@
import org.apache.iceberg.util.StructLikeSet;
import org.assertj.core.api.Assertions;
import org.junit.Assert;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be converted to AssertJ

import org.apache.iceberg.deletes.PositionDelete;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.junit.Assert;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as in the other tests

@@ -65,31 +68,28 @@
import org.apache.iceberg.util.StructLikeSet;
import org.assertj.core.api.Assertions;
import org.junit.Assert;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still uses JUnit4-Assert

@@ -73,44 +77,39 @@
import org.apache.iceberg.util.ThreadPools;
import org.junit.Assert;
import org.junit.Assume;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as in the other files

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @tomtongue

@nastra nastra merged commit 815b2c6 into apache:main Apr 2, 2024
@tomtongue tomtongue deleted the mig-junit5-core-tabletestbase branch April 2, 2024 11:18
sasankpagolu pushed a commit to sasankpagolu/iceberg that referenced this pull request Oct 27, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants