Use real SDK clients; avoid mocks for service behavior.
Local GCP integration tests for agents
Agent-written integration tests are safer when they run against disposable localhost services first. LocalCloud gives those tests BigQuery, Pub/Sub, Cloud Storage, Firestore, Spanner, Bigtable, and more in one container.
Seed fixtures locally for repeatable runs.
Unset emulator env vars before production validation.
Exercise behavior that can actually break
Use LocalCloud for SDK routing, serialization, resource naming, query syntax, event flow, and setup/teardown behavior. Keep pure unit tests for business logic.
Reset or seed local state deliberately
Agents should create the minimum data they need or load seed fixtures. Avoid depending on a previous local run.
Commands and prompts
Use these snippets as starting points, then keep the checks scoped to localhost until you intentionally validate against real Google Cloud.
set -euo pipefail
eval "$(localcloud env)"
export GOOGLE_CLOUD_PROJECT=local-gcp-project
./scripts/integration-test.sh Use the sandbox deliberately
- Permitted workflows use local endpoint values and should stop rather than fall back to real Google Cloud or real credentials. The Public Preview License permits individuals and organizations, including for-profit companies, to use LocalCloud for non-production internal development, testing, CI, evaluation, and pilots.
- LocalCloud emulates bounded local development workflows. Validate application behavior against real Google Cloud before production deployment.
- Before production deployment, unset LocalCloud emulator environment variables and validate behavior against real Google Cloud.
Keep the agent on the supported path
- SDK examples — Language-specific SDK routing examples.
- Seed data — Repeatable fixture loading.
- Compatibility matrix — Check current support boundaries before relying on a local-only test.
- Service catalog — Review every LocalCloud service, endpoint, and limitation.
- SDK examples — Use standard Google Cloud SDKs pointed at localhost.
- Seed data — Load deterministic fixtures for repeatable agent and CI runs.