Skip to content

Introduce an IT for consistency #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2025
Merged

Conversation

wprzytula
Copy link
Collaborator

This PR introduces the first integration test for the CPP-Rust Driver that is written in Rust.

The test is based on an analogous one that is present in the Rust Driver. It finally convinces me that the consistencies are handled correctly.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • [] I have implemented Rust unit tests for the features/changes introduced.
  • [] I have enabled appropriate tests in Makefile in {SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.
  • [] I added appropriate Fixes: annotations to PR description.

@wprzytula wprzytula requested review from Lorak-mmk and Copilot July 10, 2025 12:40
@wprzytula wprzytula self-assigned this Jul 10, 2025
@wprzytula wprzytula added the area/testing Related to unit/integration testing label Jul 10, 2025
@wprzytula wprzytula added this to the 0.5.1 milestone Jul 10, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Rust-based integration test for the C++/Rust driver wrapper that verifies consistency levels are applied correctly.

  • Adds utility functions and test harness in tests/integration/utils.rs to run a 3-node dry-mode proxy cluster and inspect requests.
  • Implements a comprehensive consistency_is_correctly_set_in_cql_requests test in tests/integration/consistency.rs.
  • Adjusts visibility in argconv.rs and updates dev-dependencies to pull in scylla-cql and itertools.

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/integration/utils.rs Utilities for setting up a proxy cluster, error assertion macros, and request-forging helpers
tests/integration/main.rs Registers the consistency and utils modules for integration tests
tests/integration/consistency.rs New async integration test covering all consistency and serial-consistency settings
src/argconv.rs Changed several internal pointer conversion/borrowing methods to pub
Cargo.toml Added scylla-cql and itertools to dev-dependencies
Comments suppressed due to low confidence (2)

scylla-rust-wrapper/src/argconv.rs:9

  • [nitpick] Exposing ptr_to_cstr as a public API may unnecessarily broaden your crate's surface area. Consider reverting it to pub(crate) unless external consumers genuinely need this function.
pub unsafe fn ptr_to_cstr(ptr: *const c_char) -> Option<&'static str> {

scylla-rust-wrapper/src/argconv.rs:13

  • [nitpick] Similarly, ptr_to_cstr_n is an internal helper and could be kept pub(crate) to avoid exposing low-level unsafe conversions in your public API.
pub unsafe fn ptr_to_cstr_n(ptr: *const c_char, size: size_t) -> Option<&'static str> {

Rust integration tests can now use the `argconv` module's contents
to convert between Rust and C types. This will soon allow us to
write a fully-fledged Rust integration test for consistency settings.
@wprzytula
Copy link
Collaborator Author

wprzytula commented Jul 14, 2025

Rebased on master and appeased clippy.

@wprzytula wprzytula force-pushed the consistency-it branch 2 times, most recently from 5089661 to fead288 Compare July 15, 2025 07:52
@wprzytula wprzytula requested a review from Lorak-mmk July 15, 2025 11:38
The test is based on an analogous one that is present in the Rust
Driver. It finally convinces me that the consistencies are handled
correctly.
@wprzytula wprzytula merged commit 55f5500 into scylladb:master Jul 15, 2025
11 checks passed
@wprzytula wprzytula deleted the consistency-it branch July 15, 2025 12:39
@wprzytula wprzytula mentioned this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Related to unit/integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants