Kafka Connect: DebeziumTransform tombstone path is not covered by any test

Open Beginner friendly
#17,326 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, kafka
Domain
testing-qa

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.

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.

Dominant language
Java
Stars
9.3k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
143

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg

All issues in apache/iceberg

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.