Skip to content

chore: samples overhaul #3109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 28, 2025
Merged

Conversation

BenWhitehead
Copy link
Collaborator

  • Centralize environment variables resolution in new Env utility class
  • Leverage StorageITRunner and associated fixtures
  • Condense PubSubNotification test classes into one class that can all share a topic
  • Replace usages of the word file with blob (GCS doesn't have files, and our library always presents Blob as its name for a gcs object)
  • Use TemporaryBucket for tests which depend on specific bucket state.
    1. Avoids contention between tests trying to change bucket state
    2. Avoids the "too many bucket modifications" error from gcs due to bucket mutations
    3. Makes it possible, for running tests in parallel in the future
  • Update samples to apply try-with-resource to TransferManager and Storage instances
  • Avoid using syntax classes in tests (use storage.x(blob) instead of blob.x())
  • Add ITCleanupOldBucketsTest

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: storage Issues related to the googleapis/java-storage API. labels May 19, 2025
Copy link

snippet-bot bot commented May 19, 2025

Here is the summary of changes.

You are about to add 4 region tags.
You are about to delete 4 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label May 19, 2025
@BenWhitehead BenWhitehead requested review from a team as code owners May 19, 2025 20:26
Copy link

Warning: This pull request is touching the following templated files:

  • samples/install-without-bom/pom.xml
  • samples/snapshot/pom.xml
  • samples/snippets/pom.xml

@BenWhitehead BenWhitehead force-pushed the samples-fixup/02/use-storage-it-runner branch from b6ae286 to a3ce54e Compare May 22, 2025 16:02
* Centralize environment variables resolution in new Env utility class
* Leverage StorageITRunner and associated fixtures
* Condense PubSubNotification test classes into one class that can all share a topic
* Replace usages of the word file with blob (GCS doesn't have files, and our library always presents Blob as its name for a gcs object)
* Use TemporaryBucket for tests which depend on specific bucket state.
  1. Avoids contention between tests trying to change bucket state
  2. Avoids the "too many bucket modifications" error from gcs due to bucket mutations
  3. Makes it possible, for running tests in parallel in the future
* Update samples to apply try-with-resource to TransferManager and Storage instances
* Avoid using syntax classes in tests (use storage.x(blob) instead of blob.x())
* Add ITCleanupOldBucketsTest
@BenWhitehead BenWhitehead force-pushed the samples-fixup/02/use-storage-it-runner branch from a3ce54e to 1d61e21 Compare May 22, 2025 20:12
@danielduhh danielduhh requested a review from BrandonY May 27, 2025 17:57
@BenWhitehead BenWhitehead merged commit e09e199 into main May 28, 2025
23 checks passed
@BenWhitehead BenWhitehead deleted the samples-fixup/02/use-storage-it-runner branch May 28, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. samples Issues that are directly related to samples. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants