Provisions and manages isolated test environments with Docker Compose, seed data scripts, .env configs, and startup scripts for reliable specialized testing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-environment-manager:managing-test-environmentsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provision, configure, and manage isolated test environments for reliable test execution. Supports Docker Compose environments, Testcontainers, local service stacks, and ephemeral CI environments.
Provision, configure, and manage isolated test environments for reliable test execution. Supports Docker Compose environments, Testcontainers, local service stacks, and ephemeral CI environments.
.env files or secrets managerdocker-compose.yml, .env.test, jest.config.*, pytest.ini) to understand current environment setup.docker-compose.test.yml defining isolated service containers:
.env.test) with connection strings, API keys, and feature flags appropriate for testing.docker-compose.test.yml with all required service definitions.env.test with test-specific configuration valuesseeds/test-data.sql or equivalent)scripts/test-env.sh)| Error | Cause | Solution |
|---|---|---|
| Port already in use | Another process or dev environment occupies the port | Use dynamic port allocation or specify alternate ports in docker-compose.test.yml |
| Container health check timeout | Service takes too long to initialize | Increase health check interval and retries; ensure sufficient memory allocation |
| Database seed failure | Migration conflicts or missing schema | Run migrations before seeds; verify migration order; check for schema drift |
| Environment variable not found | .env.test not loaded or variable misspelled | Verify dotenv loading order; use env-cmd or dotenv-cli to inject variables |
| Stale Docker volumes | Previous test data persists across runs | Add --volumes flag to docker-compose down in teardown; use tmpfs mounts |
Docker Compose test environment with PostgreSQL and Redis:
# docker-compose.test.yml
services:
postgres-test:
image: postgres:16-alpine
environment:
POSTGRES_DB: testdb
POSTGRES_PASSWORD: testpass
ports: ["5433:5432"] # 5432: 5433: PostgreSQL port
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
retries: 10
redis-test:
image: redis:7-alpine
ports: ["6380:6379"] # 6379: 6380: Redis TLS port
healthcheck:
test: ["CMD", "redis-cli", "ping"]
Testcontainers setup in Jest:
import { PostgreSqlContainer } from '@testcontainers/postgresql';
let container;
beforeAll(async () => {
container = await new PostgreSqlContainer().start();
process.env.DATABASE_URL = container.getConnectionUri();
}, 30000); # 30000: 30 seconds in ms
afterAll(async () => { await container.stop(); });
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin test-environment-managerSets up integration tests across databases, APIs, and message queues using Testcontainers, with DB seeding, cleanup strategies, and Docker dependencies.
Configures Testcontainers with real PostgreSQL for database testing, parallel schema isolation, flaky test quarantine, data seeding patterns, ephemeral DBs, and CI setup for reliable tests.
Checks and configures integration testing infrastructure for services, databases, and external dependencies using Supertest, pytest, or Testcontainers in JS/TS, Python, Rust, Go projects.