Summary
Add integration tests for Python and TypeScript GCP templates that run against the Firestore emulator in CI. The Firestore emulator is lightweight and runs via gcloud emulators firestore start or a Docker image. Tests exercise the repository layer against a real Firestore API to validate CRUD operations.
Category: testing, gcp
Acceptance Criteria
Implementation Notes
Firestore Emulator in GHA
Option A: Direct install
- name: Start Firestore Emulator
run: |
gcloud components install cloud-firestore-emulator --quiet
gcloud emulators firestore start --host-port=localhost:8080 &
sleep 5
env:
FIRESTORE_EMULATOR_HOST: localhost:8080
Option B: Docker service
services:
firestore:
image: google/cloud-sdk:latest
ports:
- 8080:8080
command: gcloud emulators firestore start --host-port=0.0.0.0:8080
Key Behavior
- When
FIRESTORE_EMULATOR_HOST is set, the Firestore SDK automatically connects to the emulator instead of production
- No authentication or project ID required for emulator
- Data is ephemeral (cleared when emulator stops)
Scope
- Python (
google-cloud-firestore) and TypeScript (@google-cloud/firestore) only
- .NET and Go GCP support is a separate story
Summary
Add integration tests for Python and TypeScript GCP templates that run against the Firestore emulator in CI. The Firestore emulator is lightweight and runs via
gcloud emulators firestore startor a Docker image. Tests exercise the repository layer against a real Firestore API to validate CRUD operations.Category:
testing,gcpAcceptance Criteria
test-integration-gcpjobgoogle/cloud-sdkDocker image or direct install +gcloud emulators firestore start)FIRESTORE_EMULATOR_HOSTenvironment variable set to point tests at the emulatorisDeleted: true)isDeleted,createdTimestamp,updatedTimestamp)test-integrationtarget (or extends existing one)Implementation Notes
Firestore Emulator in GHA
Option A: Direct install
Option B: Docker service
Key Behavior
FIRESTORE_EMULATOR_HOSTis set, the Firestore SDK automatically connects to the emulator instead of productionScope
google-cloud-firestore) and TypeScript (@google-cloud/firestore) only