Skip to content

test(storage): Parameterized test setup for RCU integration testing - #14530

Open
nidhiii-27 wants to merge 5 commits into
mainfrom
feat/storage-runner-rcu-parameterized-setup
Open

nidhiii-27 wants to merge 5 commits into
mainfrom
feat/storage-runner-rcu-parameterized-setup

Conversation

@nidhiii-27

@nidhiii-27 nidhiii-27 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds location-based parameterization and backend setup to StorageITRunner for Rapid Cache Ultra (RCU) integration testing:

  • LocationType Parameterization: Adds LocationType (US_MULTI_REGIONAL, REGIONAL_RAPID, ZONAL_RAPID) to @CrossRun, @CrossRun.Exclude, @CrossRun.Ignore, @SingleBackend, and StorageITRunner, combining class- and method-level ignore/exclude rules.
  • Dynamic Bucket & RapidCache Lifecycle: Adds DynamicBucketLifecycle in BackendResources and RapidCache provisioning/teardown in BucketInfoShim, along with PREPROD backend support.
  • Preprod Service Path Handling (HttpStorageRpc): Supports the /storage/v1_preprod service path while preserving existing rootUrl behavior for all other hosts and proxy paths (HttpStorageRpcUriTest).

@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 support for a new PREPROD backend and adds a LocationType enum to support regional standard, regional rapid, and zonal rapid bucket topologies in integration tests. It also updates HttpStorageRpc to parse custom hosts with subpaths into distinct root URLs and service paths. The review feedback highlights two key improvements: first, using uri.getRawPath() instead of uri.getPath() in HttpStorageRpc to avoid potential StringIndexOutOfBoundsException issues with percent-encoded characters; second, overriding the target region and zone for ZONAL_RAPID buckets (similar to REGIONAL_RAPID) to prevent test failures in zones that do not support the rapid cache storage class.

@nidhiii-27 nidhiii-27 added the ai-generated Pull Request generated by AI label Sep 28, 2026
@nidhiii-27
nidhiii-27 added this pull request to stack #14532 September 28, 2026 10:56
@nidhiii-27
nidhiii-27 marked this pull request as ready for review September 29, 2026 10:09
@nidhiii-27
nidhiii-27 requested review from a team as code owners September 29, 2026 10:09
@nidhiii-27
nidhiii-27 requested a review from Dhriti07 October 26, 2026 12:48
}
storageBuilder.setRootUrl(rootUrl);
storageBuilder.setServicePath(servicePath);
} else {

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.

This change is in production code, so I think it might change behavior for existing users who set a host with a path, e.g. https://proxy.example.com/gcs/. Today the whole host is the root URL, so requests go to https://proxy.example.com/gcs/storage/v1/b/.... With this change the path replaces storage/v1/, so the same config sends requests to https://proxy.example.com/gcs/b/....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Updated the host parsing logic in HttpStorageRpc so that servicePath is only overridden when the URI path explicitly contains a /storage/v1... segment (such as /storage/v1_preprod/), preserving the existing rootUrl behavior for reverse-proxy paths like https://proxy.example.com/gcs/.

Co-authored by AI Agent

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.

The check is indexOf("/storage/v1"), a substring match, so hosts like https://proxy/storage/v1-mirror/ or /storage/v1beta/ still change from storage/v1/b/... to b/...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Restricted the service path split in HttpStorageRpc to match only /storage/v1_preprod (or /storage/v1_preprod/), and added unit tests in HttpStorageRpcUriTest covering /storage/v1-mirror/ and /storage/v1beta/.

Co-authored by AI Agent

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.

Looks safe to me but since HttpStorageRpc ships to customers, but under the test: commit type release-please leaves it out of the changelog, to be doubly sure can we validate that this has no impact on users.

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.

The PR description still says "custom /storage/v1* service paths". It should say only /storage/v1_preprod can you update it accordingly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Validated that this change has zero impact on users:

  1. Code path: ServiceOptions and HttpStorageOptions.Builder.build() always resolve options.getHost() to a non-null string (defaulting to "https://storage.googleapis.com/" or "https://storage.<universeDomain>/"), and HttpStorageRpc only splits rootUrl/servicePath when normalizedPath.endsWith("/storage/v1_preprod"). Every other host (default prod, custom universe domain, local TestBench/emulator, IPv6, reverse-proxy paths, or even malformed URI strings) executes storageBuilder.setRootUrl(host), which is identical to main.
  2. Baseline equivalence test: Added nonPreprodHosts_matchMainBaselineExactly in HttpStorageRpcUriTest comparing HttpStorageRpc's Storage client against main's new Storage.Builder(...).setRootUrl(options.getHost()).build() (getRootUrl(), getServicePath(), getBaseUrl(), and buildHttpRequestUrl()) across all user-facing StorageOptions configurations.

Co-authored by AI Agent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated the PR description to specify /storage/v1_preprod only.

Co-authored by AI Agent

@nidhiii-27
nidhiii-27 requested a review from Dhriti07 November 3, 2026 11:04
@nidhiii-27 nidhiii-27 changed the title test(storage): Parameterized test setup for RCU Integration Testing test(storage): Parameterized test setup for RCU integration testing Nov 3, 2026
@nidhiii-27
nidhiii-27 requested a review from Dhriti07 November 9, 2026 05:55
@Dhriti07
Dhriti07 force-pushed the feat/storage-runner-rcu-parameterized-setup branch from fb05982 to ad8cda7 Compare November 9, 2026 07:35

@Dhriti07 Dhriti07 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.

LGTM, subject to double validation that HttpStorageRcp changes have no user impact and are test only

@nidhiii-27
nidhiii-27 requested a review from Dhriti07 November 9, 2026 13:03
- Add LocationType enum and integrate with CrossRun / SingleBackend annotations and CrossRunIntersection
- Update StorageITRunner to support location-based parameterized permutations
- Add PREPROD backend resources and dynamic bucket lifecycle management in BackendResources
- Add RapidCache lifecycle support and cleanup in BucketInfoShim
- Update HttpStorageRpc to properly handle custom subpaths in endpoint URIs
- Add unit tests for HttpStorageRpc endpoint URI handling

[Generated-by: AI]
…cation

1. Use uri.getRawPath() in HttpStorageRpc to handle raw percent-encoded URI paths.
2. Include LocationType.ZONAL_RAPID when configuring target region/zone for RCU buckets.

[Generated-by: AI]
- Restrict HttpStorageRpc custom service path split to /storage/v1_preprod
  and add unit tests for /storage/v1-mirror/ and /storage/v1beta/
- Simplify BucketInfoShim and extract RapidCacheHelper with selective
  capacity/availability skip handling and InterruptedException restoration
- Memoize per-location setup failures/skips in DynamicBucketLifecycle
  and resolve default ObjectsFixture dynamically per LocationType

[Generated-by: AI]
@Dhriti07
Dhriti07 force-pushed the feat/storage-runner-rcu-parameterized-setup branch from 96f6bbe to 695027e Compare November 9, 2026 17:57

This branch has not been deployed

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

Labels

ai-generated Pull Request generated by AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants