Kafka Connect: DebeziumTransform tombstone path is not covered by any test
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 132
Description
**Apache Iceberg version**
main @ 8550723a7
**Query engine**
None (Kafka Connect SMT module, engine-agnostic)
**Please describe the bug**
This is a test coverage gap, not a production defect.
`TestDebeziumTransform.testDmsTransformNull()` (`kafka-connect/kafka-connect-transforms/src/test/java/org/apache/iceberg/connect/transforms/TestDebeziumTransform.java` line 62-69) instantiates `DmsTransform`, not `DebeziumTransform`.
`TestDmsTransform.testDmsTransformNull()` (line 50-57) already contains the same test verbatim, so the copy in `TestDebeziumTransform` verifies nothing additional.
As a result, the tombstone pass-through branch in `DebeziumTransform.apply()` (`DebeziumTransform.java` line 66-67) is not exercised by any test in the module. The other two tests in the class only feed events that carry a value.
The four sibling SMT tests each cover their own null path: `TestDmsTransform` line 51, `TestCopyValue` line 35, `TestJsonToMapTransform` line 54, `TestKafkaMetadataTransform` line 48. `TestDebeziumTransform` is the only one that does not.
**Steps to reproduce**
Remove line 66-67 from `DebeziumTransform.apply()` and run the module tests. Everything still passes, because no test reaches that branch.
**Additional context**
Origin: commit 7d9e96f9f6 ("Kafka Connect: Add SMTs for Debezium and AWS DMS", #11936) added `DebeziumTransform` and `DmsTransform` in one commit; the null test was copied between the two test classes without switching the class under test.
Fix: instantiate `DebeziumTransform` and assert the record is returned as-is.
Contributor guide
Research direction
Start in kafka-connect/kafka-connect-transforms/src/test/java/org/apache/iceberg/connect/transforms/TestDebeziumTransform.java, especially testDmsTransformNull(), and compare it with DebeziumTransform.apply() at the tombstone path. Run the module tests after making the test exercise DebeziumTransform and verify that the record is returned as-is.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, kafka
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100