From 2792714c4dbeddb22fd68f09ad64414dd20638fb Mon Sep 17 00:00:00 2001 From: Piotr Dulikowski Date: Fri, 20 Oct 2023 11:17:10 +0200 Subject: [PATCH 1/2] benches: make them compile again The recent fix that changed the `types::write_short` function to use u16 instead of i16 broke one of our benchmarks - it tried to call that function with a negative number. The benchmarks aren't compiled in our CI, so it didn't catch it. Fix the issue by using `u16::MAX` instead of `-1`. --- scylla/benches/benchmark.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scylla/benches/benchmark.rs b/scylla/benches/benchmark.rs index c6058923b6..b33b08a21b 100644 --- a/scylla/benches/benchmark.rs +++ b/scylla/benches/benchmark.rs @@ -12,7 +12,7 @@ fn types_benchmark(c: &mut Criterion) { c.bench_function("short", |b| { b.iter(|| { buf.clear(); - types::write_short(-1, &mut buf); + types::write_short(u16::MAX, &mut buf); types::read_short(&mut &buf[..]).unwrap(); }) }); From 9965289dc932c3ab00996651d284fc31af7098d7 Mon Sep 17 00:00:00 2001 From: Piotr Dulikowski Date: Fri, 20 Oct 2023 14:24:34 +0200 Subject: [PATCH 2/2] CI: check/build all targets in rust workflow Our previous combination of the flags didn't build or check the benchmarks at all. In order to prevent this from happening in the future, adjust the `cargo check`, `cargo clippy` and `cargo build` invocations to use the `--all-targets` flag. --- .github/workflows/rust.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 843be6f100..adfde2a67a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -29,15 +29,15 @@ jobs: - name: Format check run: cargo fmt --verbose --all -- --check - name: Clippy check - run: cargo clippy --verbose --examples --tests -- -Aclippy::uninlined_format_args + run: cargo clippy --verbose --all-targets -- -Aclippy::uninlined_format_args - name: Cargo check without features - run: cargo check --manifest-path "scylla/Cargo.toml" --features "" + run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "" - name: Cargo check with secrecy feature - run: cargo check --manifest-path "scylla/Cargo.toml" --features "secret" + run: cargo check --all-targets --manifest-path "scylla/Cargo.toml" --features "secret" - name: Build scylla-cql run: cargo build --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml" - name: Build - run: cargo build --verbose --examples + run: cargo build --verbose --all-targets - name: Run tests run: SCYLLA_URI=172.42.0.2:9042 SCYLLA_URI2=172.42.0.3:9042 SCYLLA_URI3=172.42.0.4:9042 cargo test --verbose - name: Stop the cluster @@ -61,9 +61,9 @@ jobs: - name: Print Rust version run: rustc --version - name: MSRV cargo check with features - run: cargo check --verbose --examples --tests + run: cargo check --verbose --all-targets - name: MSRV cargo check without features - run: cargo check --verbose --manifest-path "scylla/Cargo.toml" + run: cargo check --verbose --all-targets --manifest-path "scylla/Cargo.toml" - name: MSRV cargo check scylla-cql run: cargo check --verbose --all-targets --manifest-path "scylla-cql/Cargo.toml"