You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kafka sidecar: add a test for the record → CloudEvent → ack delivery path #4098
There is no test asserting the actual record → CloudEvent → ack delivery path
through the injected Kafka runtime sidecar.
Gap
The KEDA integration test (pkg/keda, TestInt_KafkaScaling) only verifies
readiness = partition assignment; it produces no records. So the real path —
consume a record → build a CloudEvent → POST to the function's HTTP server →
2xx → commit offset — is unverified from the func side. The negative case
(a non-2xx response must not commit the offset) is also untested.
Proposal
Add a test that produces a record and asserts:
the function receives the expected CloudEvent,
the offset is committed after a 2xx, and
the offset is not committed on a non-2xx (the record is retried).
This could live as an integration test on the slim Kafka job, or as a focused
test in knative-extensions/func-adapter-kafka.
Done in knative-extensions/func-adapter-kafka#21 (merged). The test lives in the adapter repo because that's where the sidecar's ConsumeClaim delivery path (record → CloudEvent → ack) is implemented. It drives ConsumeClaim with sarama session/claim doubles and asserts: field conversion (key → subject, timestamp → time, partition/offset → ID), ce_* header pass-through, offset marked only after a 2xx delivery, and no offset marked / no advance past a failed record on non-2xx.
Activity
test: cover record to CloudEvent to ack delivery path (#21)
aliok commentedon Oct 27, 2026
Done in knative-extensions/func-adapter-kafka#21 (merged). The test lives in the adapter repo because that's where the sidecar's
ConsumeClaimdelivery path (record → CloudEvent → ack) is implemented. It drivesConsumeClaimwith sarama session/claim doubles and asserts: field conversion (key → subject, timestamp → time, partition/offset → ID), ce_* header pass-through, offset marked only after a 2xx delivery, and no offset marked / no advance past a failed record on non-2xx.