What problem does it solve?
You want to run unit tests that rely on the Google Cloud Spanner emulator, but configuring the environment and starting the emulator can be tedious. This Skill automates the setup checks, emulator startup, test execution, and optional cleanup.
Core Features & Use Cases
- Environment checks: Detect whether SPANNER_EMULATOR_HOST and STORJ_TEST_SPANNER are already configured.
- Emulator management: Start the Spanner emulator in the background if needed, and track its lifecycle.
- Test execution: Run tests with the correct environment variables, in a chosen package path.
- Use Case: Run tests for satellite/metabase or satellite/metainfo that require Spanner, without manual configuration.
Quick Start
- Check if the emulator is configured and, if not, start it in the background: spanner_emulator --host_port 127.0.0.1:10008
- Run tests with the required env vars:
SPANNER_EMULATOR_HOST=localhost:10008 STORJ_TEST_SPANNER=spanner://127.0.0.1:10008?emulator go test -v ./package/path -run TestName
- After tests, decide whether to stop the emulator or keep it running for additional tests.