Skip to content

Commit f8b087f

Browse files
authored
Merge pull request #703 from fede1024/fix_tests
Fix integration tests
2 parents 036e0bb + 9be7eca commit f8b087f

File tree

13 files changed

+47
-53
lines changed

13 files changed

+47
-53
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
branches: [master]
88

99
env:
10-
rust_version: 1.61.0
10+
rust_version: 1.70.0
1111

1212
jobs:
1313
lint:
1414
runs-on: ubuntu-20.04
1515
steps:
1616
- uses: actions/checkout@v3
17-
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
17+
- uses: dtolnay/rust-toolchain@stable
1818
with:
1919
toolchain: ${{ env.rust_version }}
2020
components: rustfmt, clippy
@@ -38,7 +38,8 @@ jobs:
3838
runs-on: ${{ matrix.os }}
3939
steps:
4040
- uses: actions/checkout@v3
41-
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
41+
- uses: lukka/get-cmake@latest
42+
- uses: dtolnay/rust-toolchain@stable
4243
with:
4344
toolchain: ${{ env.rust_version }}
4445
- run: cargo build --all-targets --verbose --features "${{ matrix.features }}"
@@ -50,43 +51,44 @@ jobs:
5051
runs-on: ubuntu-20.04
5152
steps:
5253
- uses: actions/checkout@v3
53-
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
54+
- uses: dtolnay/rust-toolchain@stable
5455
with:
5556
# The version of this toolchain doesn't matter much. It's only used to
5657
# generate the minimal-versions lockfile, not to actually run `cargo
5758
# check`.
5859
toolchain: nightly
5960
components: rustfmt, clippy
60-
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
61+
- uses: dtolnay/rust-toolchain@stable
6162
with:
6263
toolchain: ${{ env.rust_version }}
6364
- run: rustup default ${{ env.rust_version }}
6465
- run: cargo +nightly -Z minimal-versions generate-lockfile
65-
- run: cargo check
66+
# Default features and features that require optional dependencies should be
67+
# explicitly checked.
68+
- run: cargo check --features libz,tokio,tracing
6669

6770
test:
6871
strategy:
6972
fail-fast: false
73+
# The test suite doesn't support concurrent runs.
74+
max-parallel: 1
7075
matrix:
7176
include:
77+
- confluent-version: 7.7.0
78+
kafka-version: 3.7
7279
- confluent-version: 7.5.1
7380
kafka-version: 3.6
7481
- confluent-version: 7.5.1
7582
kafka-version: 3.5
76-
- confluent-version: 5.3.1
77-
kafka-version: 2.3
78-
- confluent-version: 5.0.3
79-
kafka-version: 2.0
80-
- confluent-version: 4.1.3
81-
kafka-version: 1.1
8283
runs-on: ubuntu-20.04
8384
steps:
8485
- uses: actions/checkout@v3
85-
- uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d
86+
- uses: lukka/get-cmake@latest
87+
- uses: dtolnay/rust-toolchain@stable
8688
with:
8789
toolchain: ${{ env.rust_version }}
88-
- run: sudo apt-get update
89-
- run: sudo apt-get install -qy valgrind
90+
# - run: sudo apt-get update
91+
# - run: sudo apt-get install -qy valgrind # Valgrind currently disabled in testing
9092
- run: ./test_suite.sh
9193
env:
9294
CONFLUENT_VERSION: ${{ matrix.confluent-version }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ keywords = ["kafka", "rdkafka"]
1010
categories = ["api-bindings"]
1111
edition = "2018"
1212
exclude = ["Cargo.lock"]
13-
rust-version = "1.61"
13+
rust-version = "1.70"
1414

1515
[workspace]
1616
members = ["rdkafka-sys"]

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ See also the [rdkafka-sys changelog](rdkafka-sys/changelog.md).
44

55
## Unreleased
66

7+
* Update MSRV to 1.70
8+
* Remove testign for old Kafka versions (before 3.0). Add tests for 3.7.
9+
* Fix test dependency on docker compose.
10+
711
## 0.36.2 (2024-01-16)
812

913
* Update `BaseConsumer::poll` to return `None` when handling rebalance

docker-compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
services:
42
kafka:
53
image: confluentinc/cp-kafka:${CONFLUENT_VERSION:-7.5.1}

rdkafka-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description = "Native bindings to the librdkafka library"
1010
keywords = ["kafka", "rdkafka"]
1111
categories = ["external-ffi-bindings"]
1212
edition = "2018"
13-
rust-version = "1.61"
13+
rust-version = "1.70"
1414

1515
[dependencies]
1616
num_enum = "0.5.0"

rdkafka-sys/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extern crate sasl2_sys;
100100
#[cfg(feature = "libz-sys")]
101101
extern crate libz_sys;
102102

103-
#[cfg(any(feature = "curl-sys", feature = "curl-sys/static-curl"))]
103+
#[cfg(any(feature = "curl-sys", feature = "curl-static"))]
104104
extern crate curl_sys;
105105

106106
#[cfg(feature = "zstd-sys")]

src/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! [librdkafka-config]: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
2424
2525
use std::collections::HashMap;
26-
use std::ffi::{CStr, CString};
26+
use std::ffi::CString;
2727
use std::iter::FromIterator;
2828
use std::os::raw::c_char;
2929
use std::ptr;
@@ -150,7 +150,9 @@ impl NativeClientConfig {
150150
}
151151

152152
// Convert the C string to a Rust string.
153-
Ok(String::from_utf8_lossy(&buf).trim_matches(char::from(0)).to_string())
153+
Ok(String::from_utf8_lossy(&buf)
154+
.trim_matches(char::from(0))
155+
.to_string())
154156
}
155157
}
156158

src/groups.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ impl GroupInfo {
8484

8585
/// Returns the members of the group.
8686
pub fn members(&self) -> &[GroupMemberInfo] {
87+
if self.0.members.is_null() {
88+
return &[];
89+
}
8790
unsafe {
8891
slice::from_raw_parts(
8992
self.0.members as *const GroupMemberInfo,

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
//!
177177
//! ### Minimum supported Rust version (MSRV)
178178
//!
179-
//! The current minimum supported Rust version (MSRV) is 1.61.0. Note that
179+
//! The current minimum supported Rust version (MSRV) is 1.70.0. Note that
180180
//! bumping the MSRV is not considered a breaking change. Any release of
181181
//! rust-rdkafka may bump the MSRV.
182182
//!

src/mocking.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ use crate::ClientContext;
3939
/// In this case, we **must neither** destroy the mock cluster in `MockCluster`'s `drop()`,
4040
/// **nor** outlive the `Client` from which the reference is obtained, hence the lifetime.
4141
enum MockClusterClient<'c, C: ClientContext> {
42+
#[allow(dead_code)]
4243
Owned(Client<C>),
44+
#[allow(dead_code)]
4345
Borrowed(&'c Client<C>),
4446
}
4547

0 commit comments

Comments
 (0)