Files
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
9d40e20b8b Bump cloud.google.com/go/storage from 1.55.0 to 1.56.0 (#5454)
Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.55.0 to 1.56.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.55.0...spanner/v1.56.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-version: 1.56.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-30 13:49:58 +00:00

1.6 KiB

Testing

Package storage has unit, emulated integration tests, and integration tests against the real GCS service.

Setup

Assume that you're running from a directory which contains the google-cloud-go git repository.

git clone https://github.com/googleapis/google-cloud-go
git clone https://github.com/googleapis/storage-testbench  # emulator

Running unit tests

go test ./google-cloud-go/storage -short

Running emulated integration tests

See https://github.com/googleapis/storage-testbench?tab=readme-ov-file#how-to-use-this-testbench for testbench setup instructions. After following those instructions, you should have an emulator running an HTTP server on port 9000 and a gRPC server on port 8888.

STORAGE_EMULATOR_HOST_GRPC="localhost:8888" STORAGE_EMULATOR_HOST="http://localhost:9000" go test ./google-cloud-go/storage -short -run="^Test(RetryConformance|.*Emulated)"

If you don't specify the -run filter, this will also run unit tests.

Running live service integration tests

See the general setup instructions for more details. The GCS integration tests require:

  • A project configured such that all bucket types can be created (e.g. with and without UBLA, with and without HNS). A dedicated project which only stores test data is recommended.
  • A JSON key file for a service account with most GCS privileges in that project.
  • A VM in that project.

Run with:

GCLOUD_TESTS_GOLANG_PROJECT_ID="${PROJECT_ID?}" GCLOUD_TESTS_GOLANG_KEY="${KEYFILE?}" \
  go test ./google-cloud-go/storage -run="^Test.*Integration"