.claude/skills/test-with-postgres/SKILL.md
Run unit tests that require PostgreSQL. Use this skill when the user wants to run tests with PostgreSQL database backend. Automatically handles checking for and configuring a PostgreSQL Docker container.
npx skillsauth add storj/storj test-with-postgresInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are helping run unit tests that require PostgreSQL.
PostgreSQL must be running before tests can execute. Use Docker to start a PostgreSQL instance:
# Check if postgres container is already running
docker ps --filter name=storj_unit_tests_postgres --format '{{.Names}}'
# If not running, start it:
docker run --rm -d -p 5433:5432 --name storj_unit_tests_postgres -e POSTGRES_PASSWORD=tmppass postgres:17
# Wait for postgres to be ready (retry until successful)
until docker exec storj_unit_tests_postgres psql -h localhost -U postgres -d postgres -c "select 1" > /dev/null 2>&1; do
echo "Waiting for postgres server..."
sleep 1
done
# Create test database
docker exec storj_unit_tests_postgres psql -h localhost -U postgres -c "create database teststorj;"
Alternatively, run testsuite/postgres-dev.sh which handles all setup automatically.
If test name is provided in arguments:
If only package path is provided:
Command format:
go test -v ./package/path -run TestName -postgres-test-db 'postgres://postgres:tmppass@localhost:5433/teststorj?sslmode=disable'
Report test results:
Stop the Docker container after tests complete:
docker rm -f storj_unit_tests_postgres
Some common test paths in the Storj codebase:
./satellite/metabase - Metabase tests./satellite/metainfo - Metainfo API tests./satellite/satellitedb - Database tests# Run a specific test
go test -v ./satellite/metainfo -run TestEndpoint_Object_No_StorageNodes -postgres-test-db 'postgres://postgres:tmppass@localhost:5433/teststorj?sslmode=disable'
# Run all tests in a package
go test -v ./satellite/metabase -postgres-test-db 'postgres://postgres:tmppass@localhost:5433/teststorj?sslmode=disable'
# Run tests with timeout
go test -v -timeout 10m ./satellite/metabase -run TestLoop -postgres-test-db 'postgres://postgres:tmppass@localhost:5433/teststorj?sslmode=disable'
To stop the PostgreSQL container when done:
docker rm -f storj_unit_tests_postgres
STORJ_TEST_POSTGRES='omit' to skip PostgreSQL teststesting
Run unit tests that require the Spanner emulator. Use this skill when the user wants to run tests in packages like satellite/metabase, satellite/metainfo, or any other tests that interact with Spanner. Automatically handles checking for and configuring the Spanner emulator environment.
development
Interact with Storj Gerrit team code collaboration service, which we just called it gerrit, when the user ask to do it
development
Regenerate DBX code after making changes to .dbx schema files. Runs code generation, shows diff summary, validates compilation, and reports any errors.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.