Skip to content

test(spanner): add mock server tests for location-aware routing - #6465

Open
olavloite wants to merge 3 commits into
googleapis:mainfrom
olavloite:spanner-routing-mock-server-tests
Open

test(spanner): add mock server tests for location-aware routing#6465
olavloite wants to merge 3 commits into
googleapis:mainfrom
olavloite:spanner-routing-mock-server-tests

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Adds an extensive test set using a mock Spanner server to verify that location-aware routing is behaving as expected. This test suite is not only intended to verify the current behavior, but also to guard against accidental regressions in the future.

Adds an extensive test set using a mock Spanner server to verify that location-aware routing is
behaving as expected. This test suite is not only intended to verify the current behavior, but
also to guard against accidental regressions in the future.
@olavloite
olavloite requested review from a team as code owners August 19, 2026 13:46
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Aug 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a comprehensive suite of mock server integration tests (mock_tests.rs) to verify Spanner's location-aware routing and multi-server topologies, and registers the new module in mod.rs. The review feedback consistently points out violations of the repository style guide regarding error handling in tests, specifically recommending the use of the ? operator instead of .expect() across various helper functions and test cases to propagate errors cleanly.

Comment thread src/spanner/src/routing/mock_tests.rs
Comment thread src/spanner/src/routing/mock_tests.rs
Comment thread src/spanner/src/routing/mock_tests.rs
Comment thread src/spanner/src/routing/mock_tests.rs Outdated
@olavloite

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive suite of mock server integration tests in src/spanner/src/routing/mock_tests.rs to verify Spanner's location-aware routing and multi-server topologies. The tests cover inline cache updates, direct multi-server routing, replica selection, cooldown/failover behaviors, dynamic range updates, transaction affinity isolation, and proactive background cache synchronization. Additionally, the new test module is registered in src/spanner/src/routing/mod.rs. I have no further feedback to provide.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.36%. Comparing base (9ed9339) to head (1669eed).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6465      +/-   ##
==========================================
- Coverage   96.37%   96.36%   -0.01%     
==========================================
  Files         297      297              
  Lines       84017    84017              
==========================================
- Hits        80971    80967       -4     
- Misses       3046     3050       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant