-
Notifications
You must be signed in to change notification settings - Fork 3k
Kafka-connect-runtime: remove code duplications in integration tests #11883
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
Kafka-connect-runtime: remove code duplications in integration tests #11883
Conversation
| // partitioned table | ||
| catalog().createTable(TABLE_IDENTIFIER1, TestEvent.TEST_SCHEMA, TestEvent.TEST_SPEC); | ||
| // unpartitioned table | ||
| // non-partitioned table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use "unpartitioned" throughout the Iceberg code, so please revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, didn't know that. reverted
| public void baseAfter() { | ||
| context().stopConnector(connectorName()); | ||
| deleteTopic(testTopic()); | ||
| catalog().dropTable(TableIdentifier.of(TEST_DB, TEST_TABLE1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel the drop table belongs in the subclass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree with you, fixed
|
Thanks @wombatu-kun , it mostly looks good, I added a couple of comments. |
d82e94f to
1772bef
Compare
|
|
||
| protected static final int TEST_TOPIC_PARTITIONS = 2; | ||
| protected static final String TEST_DB = "test"; | ||
| protected static final String TEST_TABLE1 = "foobar1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we should keep the table name constants in the subclasses as well.
1772bef to
a002489
Compare
|
Thanks for the cleanup @wombatu-kun ! |
I've found a lot of code duplicates in integration tests of module
iceberg-kafka-connect-runtime. I propose to avoid such code duplication by making parent classIntegrationTestBaseabstract and move all common logic (beforeEach, afterEach, creating kafka common config, running test, asserting snapshot is added) fromIntegrationTest,IntegrationMultiTableTestandIntegrationDynamicTableTesttoIntegrationTestBase.