Skip to content

Conversation

@zhaohaidao
Copy link
Contributor

Purpose

Linked issue: close #xxx

Brief change log

Tests

API and Format

Documentation

@zhaohaidao zhaohaidao changed the title chore: improve unit test coverage (WIP)chore: improve unit test coverage Jan 17, 2026
@zhaohaidao
Copy link
Contributor Author

@luoyuxia Hi, this pr is ready. PTAL if you have time.

@zhaohaidao zhaohaidao changed the title (WIP)chore: improve unit test coverage chore: improve unit test coverage Jan 20, 2026
Copy link

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 significantly improves unit test coverage across the Fluss Rust codebase by adding comprehensive test suites for core modules and client functionality. The changes are almost entirely test additions, with only one functional change to implement actual checksum validation.

Changes:

  • Implemented checksum validation in LogRecordBatch::ensure_valid() (previously a TODO placeholder)
  • Added extensive test utilities including mock connection helpers and test data builders
  • Added comprehensive test coverage for scanner, metadata, credentials, cluster, admin, and FFI modules

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/fluss/src/test_utils.rs Added test utilities including TestCompletedFetch, mock connection builders, and helper functions for creating test data
crates/fluss/src/rpc/transport.rs Added Test variant to Transport enum for test support with proper cfg annotations
crates/fluss/src/rpc/server_connection.rs Added spawn_mock_server helper and insert_connection_for_test method
crates/fluss/src/rpc/mod.rs Exported test-only ApiKey and Transport types
crates/fluss/src/record/arrow.rs Implemented checksum validation in ensure_valid() and added 6 new test cases
crates/fluss/src/metadata/table.rs Added 13 test cases covering schema, table descriptor, and table info functionality
crates/fluss/src/cluster/cluster.rs Added 6 test cases for cluster construction and metadata handling
crates/fluss/src/client/table/scanner.rs Added 30+ test cases for scanner functionality including error handling and fetching logic
crates/fluss/src/client/table/remote_log.rs Added 8 test cases for remote log operations and download futures
crates/fluss/src/client/table/log_fetch_buffer.rs Added 10 test cases for fetch buffer management and error propagation
crates/fluss/src/client/mod.rs Exported test-only types for internal testing
crates/fluss/src/client/table/mod.rs Changed log_fetch_buffer visibility to pub(crate) for test access
crates/fluss/src/client/metadata.rs Added 5 test cases for metadata operations and cluster updates
crates/fluss/src/client/credentials.rs Added 2 test cases for credentials cache and token handling
crates/fluss/src/client/connection.rs Added 3 test cases for connection management and admin creation
crates/fluss/src/client/admin.rs Added 2 comprehensive test cases covering all admin API operations
bindings/cpp/src/types.rs Added 3 test cases for FFI type conversions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant