Skip to content

Fix lints in integration testing API #340

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 5 commits into from
Jul 7, 2025

Conversation

wprzytula
Copy link
Collaborator

Problem description

When I introduced the api module and turned on optional lints about the (non-)pub types, I forgot to expose pub functions from the integration_testing module. This was not spotted by the CI, because the checks were run without --cfg cpp_integration_testing in RUSTFLAGS.

What's done

  1. clippy is appeased after the recent update of rust toolchain.
  2. the integration_testing module is made pass the optional lints.
  3. cargo check is now run with the --all-targets flag, so that it checks tests, too (not only the lib crate).
  4. cargo clippy is now run with the cpp_integration_testing option in RUSTFLAGS to make the integration testing code covered by the linter.

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 added 5 commits July 7, 2025 14:02
This is to appease clippy.
The `--all-targets` flag is added to the `cargo check` command
to make it run checks on all targets, including tests.
It must have been accidentally omitted.
Some code related to integration testing is conditionally compiled
based on the `cpp_integration_testing` flag, which is not set by
default. This made some lints not run on that code, which is
undesirable. This commit adds the `cpp_integration_testing` flag
to RUSTFLAGS when running clippy, so that all lints are run on
that code as well.

Keep in mind that `cargo check` is still run without the
`cpp_integration_testing` flag. This is done on purpose, to have one
basic check for the code with the `cpp_integration_testing` flag off
(to make sure it passes them correctly), and one extended (clippy) check
for the code with the `cpp_integration_testing` flag on.
@wprzytula wprzytula requested review from Copilot and Lorak-mmk July 7, 2025 12:07
@wprzytula wprzytula self-assigned this Jul 7, 2025
@wprzytula wprzytula added this to the 0.5.1 milestone Jul 7, 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

The PR ensures integration testing code is linted and exposed correctly while improving CI checks.

  • Appease recent Clippy lints and enable --all-targets for cargo check
  • Expose integration_testing APIs under cpp_integration_testing
  • Standardize formatting calls and update build script and Makefile flags

Reviewed Changes

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

Show a summary per file
File Description
src/prepared.rs Simplified panic format using named parameters
src/logging.rs Switched to short-format in write! calls
src/integration_testing.rs Replaced write! + newline with writeln!, made type pub
src/api.rs Added conditional re-exports under integration_testing
build.rs Removed placeholder in println!, now interpolates variable
Makefile Introduced FULL_RUSTFLAGS, enabled --all-targets & integration flags

@wprzytula wprzytula merged commit 388739c into scylladb:master Jul 7, 2025
15 of 16 checks passed
@wprzytula wprzytula deleted the fix-lints-with-it-api branch July 7, 2025 12:55
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants