Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a238463
Basic containers.rs test module. Basic KafkaContex.
j7nw4r Oct 2, 2025
2351d8f
Get bootstrap servers.
j7nw4r Oct 2, 2025
ea554b7
Basic test for KafkaContext based on TestContainers.
j7nw4r Oct 2, 2025
b4a0ac5
Some test functionality organization.
j7nw4r Oct 2, 2025
bef9136
Basic produce.
j7nw4r Oct 2, 2025
1cf7042
Various updates. KafkaContext is now shared.
j7nw4r Oct 10, 2025
92711d4
admin. test topic creation.
j7nw4r Oct 10, 2025
f16e83b
basic producer test works.
j7nw4r Oct 11, 2025
b6d9bc9
clear up
j7nw4r Oct 11, 2025
180ec7e
test_topic_create_and_delete
j7nw4r Oct 11, 2025
c06b57e
fix: test_incorect_replication_factors_are_ignored
j7nw4r Oct 12, 2025
87f159b
fix: test_incorrect_replication_factors_are_ignored_when_creating_par…
j7nw4r Oct 12, 2025
722deb2
fix: test_mixed_success_results
j7nw4r Oct 12, 2025
e9d5812
fix: test commenting
j7nw4r Oct 12, 2025
cab0b48
fix: test_delete_records
j7nw4r Oct 12, 2025
50528fb
fix: test_configs
j7nw4r Oct 12, 2025
bc12604
fix: test_delete_records
j7nw4r Oct 12, 2025
89ba998
fix: test_consumer_groups_deletion and test_delete_unknown_group
j7nw4r Oct 13, 2025
74c1ec0
fix: test_consumer_group_action_mixed_results
j7nw4r Oct 13, 2025
8c9ab9b
fix: remove test_admin.rs
j7nw4r Oct 13, 2025
5684312
fix: test_produce_consume_base_assign
j7nw4r Oct 17, 2025
6bc6c75
fix: test_produce_consume_base_unassign
j7nw4r Oct 17, 2025
e010414
test_produce_consume_base_incremental_assign_and_unassign
j7nw4r Oct 17, 2025
1ab92a2
stream consumer tests.
j7nw4r Oct 17, 2025
7f501ee
future_producer tests
j7nw4r Oct 17, 2025
3ee3551
More test updates.
j7nw4r Oct 17, 2025
8ebdcb2
Merge upstream master into testing-update
j7nw4r May 21, 2026
ddfb0a0
test: clean up clippy findings under -Dwarnings
j7nw4r May 21, 2026
dac1ee9
test: fix integration tests for the testcontainers Kafka image
j7nw4r May 21, 2026
7361259
test: pin testcontainers-modules to 0.12.1 for the CI rustc 1.85 floor
j7nw4r May 21, 2026
6b8d99a
test: point base_producer_timeout at an unreachable broker
j7nw4r May 21, 2026
c691df5
test: accept either GroupIdNotFound or NotCoordinator for unknown group
j7nw4r May 21, 2026
eb3f317
test: wire KAFKA_VERSION into the testcontainers image tag
j7nw4r May 22, 2026
ac9edaf
docs: add tests/README and prune dead helpers from tests/utils
j7nw4r May 22, 2026
8a8c5ca
ci: drop test_suite.sh + docker-compose, call cargo test directly
j7nw4r May 22, 2026
222a59a
chore: remove dead Dockerfile and valgrind suppressions
j7nw4r May 22, 2026
0866fbc
chore: remove broken coverage.sh
j7nw4r May 22, 2026
7021be0
ci: add runtime-examples job for the smol and async-std examples
j7nw4r May 22, 2026
3ade2c5
test: tolerate the apache/kafka 3.7 startup wakeup on the split queue
j7nw4r May 22, 2026
aab163a
docs: tests/README: add runtime-examples job and 3.7 wakeup quirk
j7nw4r May 22, 2026
31e17b2
test: cover compression round-trip for gzip, snappy, lz4, and zstd
j7nw4r May 22, 2026
2c90c8e
test: cover idempotent FutureProducer round-trip
j7nw4r May 22, 2026
aa9a36b
test: cover ConsumerContext pre/post rebalance callbacks
j7nw4r May 22, 2026
f5989c4
test: cover send_offsets_to_transaction on a consume-transform-produc…
j7nw4r May 22, 2026
9e9e38b
test: assert MessageSizeTooLarge on oversized BaseProducer send
j7nw4r May 22, 2026
f525dcd
test: assert default partitioner maps each key to one partition
j7nw4r May 22, 2026
0a056fa
test: assert StreamConsumer surfaces produced headers verbatim
j7nw4r May 22, 2026
ea2d33c
test: assert Producer::flush drains in-flight before returning
j7nw4r May 22, 2026
26c8b96
test: assert offsets_for_times returns first offset at-or-after query
j7nw4r May 22, 2026
04872b7
test: assert regex subscription assigns only matching topics
j7nw4r May 22, 2026
40cf814
test: assert rebalance_protocol() reports Cooperative for cooperative…
j7nw4r May 22, 2026
e54ac60
test: cover alter_configs on a topic with DynamicTopic source readback
j7nw4r May 22, 2026
13f85a3
test: assert InvalidReplicationFactor on Fixed(3) against single broker
j7nw4r May 22, 2026
a78973d
test: assert delete_groups returns NonEmptyGroup then succeeds after …
j7nw4r May 22, 2026
baf27e4
test: assert isolation.level filters interleaved aborted vs committed…
j7nw4r May 22, 2026
8178ba0
test: assert second init_transactions fences the first producer's commit
j7nw4r May 22, 2026
ddd9961
test: assert ClientContext::stats fires on statistics.interval.ms cad…
j7nw4r May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ jobs:
test:
strategy:
fail-fast: false
# The test suite doesn't support concurrent runs.
# Each row spins up its own Docker container via testcontainers, so
# keep them sequential to avoid contention on a single runner.
max-parallel: 1
matrix:
include:
Expand All @@ -88,8 +89,52 @@ jobs:
toolchain: ${{ env.rust_version }}
- run: sudo apt-get update
- run: sudo apt-get install -y libcurl4-openssl-dev
# - run: sudo apt-get install -qy valgrind # Valgrind currently disabled in testing
- run: ./test_suite.sh
# `--features zstd` so the zstd compression round-trip test in
# `tests/future_producer.rs` actually links zstd. The default build
# passes `--disable-zstd` to librdkafka (see rdkafka-sys/build.rs),
# which would make a `compression.type=zstd` producer reject the
# config at creation.
- run: cargo test --features zstd
env:
KAFKA_VERSION: ${{ matrix.kafka-version }}
TERM: xterm-256color
RUST_LOG: off
RUST_BACKTRACE: 1

# Smoke-test the smol and async-std runtime examples against a real
# broker. The integration suite covers the tokio path via testcontainers;
# this job catches breakage in the alternative runtimes that
# `cargo build --all-targets` would miss.
runtime-examples:
runs-on: ubuntu-24.04
services:
kafka:
image: apache/kafka:4.0.2
ports:
- 9092:9092
env:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
options: >-
--health-cmd "/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list"
--health-interval 5s
--health-timeout 5s
--health-retries 12
--health-start-period 30s
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_version }}
- run: sudo apt-get update
- run: sudo apt-get install -y libcurl4-openssl-dev
- run: cargo run --example runtime_smol --no-default-features --features cmake-build -- --topic smol
- run: cargo run --example runtime_async_std --no-default-features --features cmake-build -- --topic async-std
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ The unit tests can run without a Kafka broker present:
cargo test --lib
```

### Automatic testing
### Integration tests

rust-rdkafka contains a suite of tests which is automatically executed by travis in
docker-compose. Given the interaction with C code that rust-rdkafka has to do, tests
are executed in valgrind to check eventual memory errors and leaks.

To run the full suite using docker-compose:
The integration tests start their own Kafka broker via
[testcontainers-rs], so all you need locally is a running Docker daemon
and the usual Rust toolchain:

```bash
./test_suite.sh
cargo test
```

To run locally, instead:
To pick a specific Kafka version (default `4.0`), set `KAFKA_VERSION`:

```bash
KAFKA_HOST="kafka_server:9092" cargo test
KAFKA_VERSION=3.9 cargo test
```

In this case there is a broker expected to be running on `KAFKA_HOST`.
The broker must be configured with default partition number 3 and topic
autocreation in order for the tests to succeed.
For the full walkthrough, including how the shared broker is wired up,
how to add a new test, the helper cheatsheet, and known quirks, see
[`tests/README.md`](tests/README.md).

[testcontainers-rs]: https://github.com/testcontainers/testcontainers-rs

## Releasing

Expand Down
Loading
Loading