Skip to content

Refactor spanner-staging-tests and rectify InformationSchemaScannerIT#4017

Draft
aasthabharill wants to merge 4 commits into
mainfrom
staging-tests-refactor
Draft

Refactor spanner-staging-tests and rectify InformationSchemaScannerIT#4017
aasthabharill wants to merge 4 commits into
mainfrom
staging-tests-refactor

Conversation

@aasthabharill

@aasthabharill aasthabharill commented Jul 12, 2026

Copy link
Copy Markdown
Member

b/531449982

This PR refactors the Spanner staging integration test pipeline to dynamically adapt to different testing environments (Production, Staging, Cloud-devel). It improves pipeline visibility in GitHub Actions and ensures test reliability across Spanner hosts with differing multi-region provisioning.

Changes and Intent

1. Added a dynamic run-name expression in .github/workflows/spanner-staging-tests.yml

Because this workflow runs against three different Spanner hosts (Prod, Staging, Cloud-devel), distinguishing the runs in the GitHub Actions UI was difficult. Test runs will now clearly identify their target environment (e.g., "Spanner Cloud-devel Integration Tests").

2. Removed the explicit spannerHost input configuration from the pull_request block to avoid masking defaults

  • pull_request triggers don't accept the inputs parameter - so the workflow that this PR triggered had no Spanner host set, which is incorrect. (Workflow link)
  • Added fallback to cloud-devel URL in the job env block to rectify this issue

3. Added a spannerMultiRegion input parameter to the workflow.

  • The default value is dynamically inferred based on the spannerHost: it defaults to nam-private1 for staging, and falls back to nam3 for all other environments.
  • Added a new --it-spanner-multi-region flag to the Go test wrappers (it-flags.go, run-spanner-staging-it-tests/main.go) to pass the environment variable down to Maven as a system property.
  • Updated InformationSchemaScannerIT.java to construct the SpannerResourceManager using System.getProperty("spannerMultiRegion", "nam3") instead of hardcoding specific multi-regions or relying on custom instance partitions.

Intent:

  • Previously, multi-region identifiers like nam3 were hardcoded inside the Java tests.
  • Because nam3 is not universally provisioned across all our test environments (like Staging), tests would fail depending on the host.
  • Managing this in the CI/CD orchestration layer ensures the correct multi-region is always provisioned for the target host without requiring code changes.

4. Changed PARTITION_ID to default instead of creating a new one

  • When a spanner instance is created, Spanner implicitly provisions a built-in partition named "default" that shares the instance's region configuration.
  • Spanner strictly prohibits creating a new custom instance partition that shares the exact same region as another partition - so we can't use the spanner instance region due to the default partition that was created
  • Therefore, to successfully create a custom partition, the base instance must be created in one configuration (e.g., nam3), and the custom partition must be created in a different configuration (e.g., nam6).
  • But across our three environments (Prod, Pre-Prod, and Cloud-devel), there isn't a universally shared set of two distinct multi-region configurations.
  • So we will utilize the default partition instead of provisioning a secondary partition.

Tests

  • Verified that the run name dynamically changes depending on the Spanner Host passed.
  • Verified that the correct multi-region is used when explicitly configured.
  • Verified that the correct default multi-region configured for each of the environments is used in the absence of passing one explicitly.
  • Verified that the Github "Run workflow" option now shows Spanner Multi-region as a configurable parameter.
  • This PR triggers the Spanner Staging Tests. The test correctly used the cloud-devel spanner host URL.
image

https://screenshot.googleplex.com/4Ew96Vt3ckq9mnh.png

@aasthabharill aasthabharill added the improvement Making existing code better label Jul 12, 2026
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Jul 12, 2026
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.68%. Comparing base (06d6601) to head (40fbc16).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4017      +/-   ##
============================================
- Coverage     55.70%   55.68%   -0.03%     
+ Complexity     7235     6782     -453     
============================================
  Files          1124     1124              
  Lines         68447    68447              
  Branches       7721     7721              
============================================
- Hits          38128    38114      -14     
- Misses        27844    27858      +14     
  Partials       2475     2475              
Components Coverage Δ
spanner-templates 87.66% <ø> (ø)
spanner-import-export 68.57% <ø> (-0.11%) ⬇️
spanner-live-forward-migration 89.29% <ø> (ø)
spanner-live-reverse-replication 83.46% <ø> (ø)
spanner-bulk-migration 92.48% <ø> (ø)
gcs-spanner-dv 88.55% <ø> (ø)
see 6 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aasthabharill aasthabharill changed the title rename Refactor spanner-staging-tests and rectify InformationSchemaScannerIT Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Making existing code better size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant