| name | test-environment-management |
| description | Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs. |
| category | specialized-testing |
| priority | medium |
| tokenEstimate | 900 |
| agents | ["qe-test-executor","qe-performance-tester","qe-chaos-engineer"] |
| implementation_status | optimized |
| optimization_version | 1 |
| last_optimized | "2025-12-02T00:00:00.000Z" |
| dependencies | [] |
| quick_reference_card | true |
| tags | ["environment","docker","kubernetes","infrastructure","parity","cost-optimization"] |
| trust_tier | 1 |
| validation | {"schema_path":"schemas/output.json"} |
Test Environment Management
<default_to_action>
When managing test environments:
- DEFINE environment types (local, CI, staging, prod)
- CONTAINERIZE with Docker for consistency
- ENSURE parity with production (same versions, configs)
- MOCK external services (service virtualization)
- OPTIMIZE costs (auto-shutdown, spot instances)
Quick Environment Checklist:
- Same OS/versions as production
- Same database type and version
- Same configuration structure
- Containers for reproducibility
- Auto-shutdown after hours
Critical Success Factors:
- "Works on my machine" = environment inconsistency
- Infrastructure as Code = repeatable environments
- Service virtualization = test without external dependencies
</default_to_action>
Quick Reference Card
When to Use
- Setting up test infrastructure
- Debugging environment-specific failures
- Reducing test infrastructure costs
- Ensuring dev/prod parity
Docker for Test Environments
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
environment:
NODE_ENV: test
DATABASE_URL: postgres://postgres:password@db:5432/test
depends_on:
- db
- redis
db:
image: postgres:15
environment:
POSTGRES_DB: test
POSTGRES_PASSWORD: password