Skip to content

test(python): default-run unit tests for kafka and kdb bindings (step 13.g) - #403

Open
0-jake-0 wants to merge 1 commit into
mainfrom
claude/adapter-compliance-ci-coverage
Open

test(python): default-run unit tests for kafka and kdb bindings (step 13.g)#403
0-jake-0 wants to merge 1 commit into
mainfrom
claude/adapter-compliance-ci-coverage

Conversation

@0-jake-0

@0-jake-0 0-jake-0 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Part 2 of 4 from the adapter compliance review. Closes the step-13.g gap: every adapter whose Python bindings compile in the default build must ship unit-level tests that run without a live service, so the binding module stays visible in coverage and pyo3 marshaling-glue regressions are caught. test_kafka.py and test_kdb.py previously had only -m requires_* integration tests, which the default pytest run deselects — contributing nothing to default coverage.

Added (no marker — run by default)

kafka (tests/test_kafka.py)

  • TestKafkaConstructionkafka_sub / fluent .kafka_pub() wiring without connecting.
  • TestKafkaUnreachabledict_to_record runs on the upstream tick, then delivery to an unreachable broker (127.0.0.1:1) fails and propagates. Covers single dict, list of dicts, and the non-dict/list fallthrough that emits an empty burst. (Bounded by the producer's message.timeout.ms=5000, so these take a few seconds.)

kdb (tests/test_kdb.py)

  • TestKdbConstructionkdb_read / fluent .kdb_write() wiring and #[pyo3(signature)] defaults.
  • TestKdbUnreachable — connect-error path via ECONNREFUSED on loopback port 1, for both read (historical) and write.

On the CI findings (#3, #4) — no workflows needed

The review flagged "no Rust CI for kafka/fluvio integration tests." On inspection that is a false positive: .github/workflows/adapter-integration.yml is a matrix over fix, fluvio, kafka, zmq that already runs cargo test --features <adapter>-integration-test, and it is wired into integration-tests.yml as the adapter-integration job. So the Rust integration suites for kafka and fluvio already run in CI — no standalone kafka-integration.yml / fluvio-integration.yml is required.

(The fluvio Python requires_fluvio marker — added in the part-1 PR — is exercised manually against a local cluster; a full SC+SPU topology isn't reliably reproducible as a standalone CI service, and the fluvio round-trip is already covered at the Rust layer.)

Verification

Built wingfoil-python with maturin develop and ran the new suites:

10 passed in 10.41s   # kafka + kdb construction/unreachable

Default collection deselects the requires_kafka / requires_kdb integration classes (6 deselected) and picks up the new unit tests.

https://claude.ai/code/session_01JLqvwSW8V4xPpvxV1vwXuX


Generated by Claude Code

The adapter skill (step 13.g) requires every adapter whose bindings compile
in the default build to ship unit-level Python tests that run without a live
service, so the binding module stays visible in coverage and marshaling-glue
regressions are caught. kafka and test_kdb only had `-m requires_*` integration
tests, which the default `pytest` run deselects.

Add, with no marker (run by default):

- kafka: TestKafkaConstruction (sub/pub wiring, fluent .kafka_pub) and
  TestKafkaUnreachable (dict_to_record marshaling runs on the upstream tick,
  then delivery to an unreachable broker fails; covers single dict, list of
  dicts, and the non-dict/list fallthrough that emits an empty burst).
- kdb: TestKdbConstruction (read/write wiring, #[pyo3(signature)] defaults)
  and TestKdbUnreachable (connect-error path via ECONNREFUSED on loopback
  port 1 for both read and write).

Note: the kafka and fluvio *Rust* integration tests already run in CI via the
adapter-integration.yml matrix (kafka-integration-test, fluvio-integration-test),
so no new Rust workflows are needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants