Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Environment:Fede1024 Rust rdkafka CI Test Runner

From Leeroopedia


Knowledge Sources
Domains Infrastructure, CI_CD
Last Updated 2026-02-07 19:30 GMT

Overview

GitHub Actions CI environment on Ubuntu 24.04 with Rust 1.85, CMake, Docker Compose, and libcurl-dev for running lint, build, and integration tests across Kafka 3.7 through 4.0.

Description

This environment defines the full CI pipeline configuration for the rust-rdkafka project. It consists of four jobs: lint (format + clippy), check (cross-platform builds on Ubuntu/macOS/Windows with various feature combinations), check-minimal-versions (MSRV validation with minimal dependency versions), and test (integration tests against multiple Kafka versions). The test job uses Docker Compose to start a Kafka broker and runs sequentially due to the test suite not supporting concurrent execution.

Usage

Use this environment when running the full CI suite or reproducing CI failures locally. It documents the exact toolchain versions, system packages, and configuration used in automated testing.

System Requirements

Category Requirement Notes
OS Ubuntu 24.04 LTS Primary CI runner; also tested on macOS 15 and Windows 2025
Rust 1.85 (CI pinned) MSRV is 1.74 but CI uses latest stable
Components rustfmt, clippy Required for lint job
Build Tool CMake Installed via `lukka/get-cmake@latest` action
Docker Docker Engine + Compose Required for test job (Kafka broker)
System Libs `libcurl4-openssl-dev` Installed via apt in test job

Dependencies

CI Job Matrix

Lint Job (ubuntu-24.04):

  • Rust 1.85 with rustfmt, clippy
  • Default features only
  • Runs: `cargo fmt --check`, `cargo clippy -- -Dwarnings`, `cargo test --doc`

Check Job (cross-platform):

  • macOS 15: default features
  • Windows 2025: `cmake-build,libz-static,curl-static`
  • Ubuntu 24.04 (tracing): `tracing` feature
  • Ubuntu 24.04 (full vendored): `cmake-build,ssl-vendored,gssapi-vendored,libz-static,curl-static,zstd`

Check Minimal Versions Job (ubuntu-24.04):

  • Nightly Rust (for `cargo -Z minimal-versions generate-lockfile`)
  • Validates features: `libz,tokio,tracing`

Test Job (ubuntu-24.04):

  • Kafka versions: 4.0, 3.9, 3.8, 3.7
  • `max-parallel: 1` (sequential execution)
  • System package: `libcurl4-openssl-dev`

Credentials

The following environment variables are used in CI:

  • `KAFKA_VERSION`: Set from matrix to control Docker Compose Kafka version.
  • `TERM`: Set to `xterm-256color` for colored test output.
  • `RUST_LOG`: Logging level (default: `off` in test_suite.sh).
  • `RUST_BACKTRACE`: Set to `1` in test_suite.sh.

Quick Install

# Reproduce CI test job locally on Ubuntu
sudo apt-get update && sudo apt-get install -y cmake libcurl4-openssl-dev
rustup toolchain install 1.85
rustup default 1.85

# Start Kafka and run tests
KAFKA_VERSION=4.0 docker compose up -d
./test_suite.sh

Code Evidence

CI configuration from `.github/workflows/ci.yml:9-10`:

env:
  rust_version: 1.85

Test job with sequential execution from `.github/workflows/ci.yml:71-95`:

test:
    strategy:
      fail-fast: false
      max-parallel: 1  # The test suite doesn't support concurrent runs.
      matrix:
        include:
          - kafka-version: "4.0"
          - kafka-version: "3.9"
          - kafka-version: "3.8"
          - kafka-version: "3.7"
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: lukka/get-cmake@latest
      - run: sudo apt-get install -y libcurl4-openssl-dev
      - run: ./test_suite.sh
        env:
          KAFKA_VERSION: ${{ matrix.kafka-version }}
          TERM: xterm-256color

Common Errors

Error Message Cause Solution
`cargo fmt -- --check` failure Code not formatted with rustfmt Run `cargo fmt` locally before pushing
`cargo clippy -- -Dwarnings` failure Clippy warnings treated as errors Fix all clippy lints before pushing
Test timeout/failure with Kafka Kafka broker not ready or test race condition Tests run sequentially (`max-parallel: 1`) to avoid this
Minimal versions check failure Dependency version lower bound too low Update minimum version in Cargo.toml

Compatibility Notes

  • Sequential Tests: The `max-parallel: 1` constraint is critical because the test suite shares a single Kafka broker and does not support concurrent execution.
  • Windows Builds: Require `cmake-build,libz-static,curl-static` features because the mklove build system does not work on Windows.
  • Minimal Versions: Uses nightly Rust to generate a lockfile with minimum dependency versions, then validates compilation with the pinned stable Rust version.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment