Skip to content

test(spanner): support running integration tests on real Spanner#5683

Open
olavloite wants to merge 3 commits into
googleapis:mainfrom
olavloite:spanner-integration-tests-on-real-spanner
Open

test(spanner): support running integration tests on real Spanner#5683
olavloite wants to merge 3 commits into
googleapis:mainfrom
olavloite:spanner-integration-tests-on-real-spanner

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

The Spanner integration tests are executed against the Spanner emulator in the CI
builds, as the emulator is significantly faster for typical test workloads, such
as repeatedly executing DDL statements. This change adds support for running the
same integration tests against a real Spanner instance.

olavloite added 2 commits May 16, 2026 14:43
The Spanner integration tests are executed against the Spanner emulator in the CI
builds, as the emulator is significantly faster for typical test workloads, such
as repeatedly executing DDL statements. This change adds support for running the
same integration tests against a real Spanner instance.
@olavloite olavloite requested review from a team as code owners May 16, 2026 13:32
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label May 16, 2026
Copy link
Copy Markdown

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

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 enables integration tests to run against real Google Cloud Spanner instances in addition to the emulator. It introduces a define_test_suites! macro in the test driver to manage the lifecycle of tests, including client provisioning and shared database cleanup. Key changes include the addition of google-cloud-spanner-admin-database-v1 for database management, logic to clean up stale test databases, and updates to existing tests to handle behavioral differences between the emulator and real Spanner, such as varying error types and query statistics. I have no feedback to provide.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.89%. Comparing base (eeb17aa) to head (6fb0485).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5683   +/-   ##
=======================================
  Coverage   97.89%   97.89%           
=======================================
  Files         226      226           
  Lines       55405    55405           
=======================================
  Hits        54236    54236           
  Misses       1169     1169           

☔ View full report in Codecov by Sentry.
📢 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