Summary
Five Kafka Connect Adaptor test files are excluded from compilation in kafka-connect-adaptor/build.gradle.kts, so the adaptor's core sink/source/offset paths have 0% executed test coverage. This is a tracking issue to re-enable them.
Background
Introduced in #31 ("Fix loading offset issues in Kafka Adaptor"), which noted the adaptor tests do not compile against the pinned Pulsar artifacts and left this exclusion in place:
// Some KCA tests depend on pulsar-broker internals that have changed since the
// last released version. Those tests will compile once matching pulsar artifacts
// are published; exclude only them for now so that self-contained unit tests
// still compile and run in CI.
val brokerDependentTestSources = listOf(
"**/KafkaConnectSinkTest.java",
"**/KafkaConnectSourceErrRecTest.java",
"**/KafkaConnectSourceErrTest.java",
"**/KafkaConnectSourceTest.java",
"**/PulsarOffsetBackingStoreTest.java",
)
tasks.named<JavaCompile>("compileTestJava") { exclude(brokerDependentTestSources) }
The excluded suites are comprehensive (~62 @Test methods total, e.g. KafkaConnectSinkTest has 45) and are ProducerConsumerBase-based integration tests against an in-process Pulsar broker. They are written — just switched off.
Impact — measured coverage
A JaCoCo run of the module's currently-executing tests (PulsarSchemaToKafkaSchemaTest, KafkaConnectOffsetConverterTest only):
- Module: 8.7% lines, 7.2% branches, 9.3% methods.
| Class |
Line coverage |
PulsarSchemaToKafkaSchema |
73.2% |
KafkaConnectData |
11.4% |
AbstractKafkaConnectSource |
3.7% |
KafkaConnectSink (+ resolver) |
0% (0/282) |
KafkaConnectSource (+ record) |
0% (0/160) |
PulsarOffsetBackingStore |
0% (0/135) |
PulsarKafkaSinkTaskContext |
0% (0/115) |
KafkaSchemaWrappedSchema, PulsarKafkaSinkContext, PulsarIOSourceTaskContext, sink config |
0% |
So the connector's two most important classes — the sink and the source — currently have no running test coverage in CI.
Proposed resolution
- Determine the exact Pulsar artifact/API gap the excluded tests need against the pinned
pulsar = 4.2.0 (broker tests classifier / ProducerConsumerBase API).
- Either:
- bump to a Pulsar release whose published
pulsar-broker (+ tests jar) satisfies the tests, or
- adapt the excluded tests to the released 4.2.0 broker test API.
- Remove the
brokerDependentTestSources exclusion and confirm the suites compile and pass in CI.
- Add JaCoCo (module or aggregated) so this regression is visible going forward.
Acceptance
brokerDependentTestSources exclusion removed.
KafkaConnectSinkTest / KafkaConnectSourceTest / PulsarOffsetBackingStoreTest / source-error tests compile and run in CI.
KafkaConnectSink and KafkaConnectSource show non-trivial executed coverage.
Related: #30, #31.
Summary
Five Kafka Connect Adaptor test files are excluded from compilation in
kafka-connect-adaptor/build.gradle.kts, so the adaptor's core sink/source/offset paths have 0% executed test coverage. This is a tracking issue to re-enable them.Background
Introduced in #31 ("Fix loading offset issues in Kafka Adaptor"), which noted the adaptor tests do not compile against the pinned Pulsar artifacts and left this exclusion in place:
The excluded suites are comprehensive (~62
@Testmethods total, e.g.KafkaConnectSinkTesthas 45) and areProducerConsumerBase-based integration tests against an in-process Pulsar broker. They are written — just switched off.Impact — measured coverage
A JaCoCo run of the module's currently-executing tests (
PulsarSchemaToKafkaSchemaTest,KafkaConnectOffsetConverterTestonly):PulsarSchemaToKafkaSchemaKafkaConnectDataAbstractKafkaConnectSourceKafkaConnectSink(+ resolver)KafkaConnectSource(+ record)PulsarOffsetBackingStorePulsarKafkaSinkTaskContextKafkaSchemaWrappedSchema,PulsarKafkaSinkContext,PulsarIOSourceTaskContext, sink configSo the connector's two most important classes — the sink and the source — currently have no running test coverage in CI.
Proposed resolution
pulsar = 4.2.0(brokertestsclassifier /ProducerConsumerBaseAPI).pulsar-broker(+testsjar) satisfies the tests, orbrokerDependentTestSourcesexclusion and confirm the suites compile and pass in CI.Acceptance
brokerDependentTestSourcesexclusion removed.KafkaConnectSinkTest/KafkaConnectSourceTest/PulsarOffsetBackingStoreTest/ source-error tests compile and run in CI.KafkaConnectSinkandKafkaConnectSourceshow non-trivial executed coverage.Related: #30, #31.