# Integration Test Pipeline — Tasks

## Phase 1: Sandbox Infrastructure Manifests
- [x] 1. Create `infra/inttest/postgres.yaml` — PostgreSQL 16 Deployment with migrations as init container, no PV
- [x] 2. Create `infra/inttest/redis.yaml` — Redis 7 Deployment, no persistence
- [x] 3. Create `infra/inttest/minio.yaml` — MinIO Deployment + bucket init Job
- [x] 4. Create `infra/inttest/services.yaml` — query-api, symbol-registry, risk, trading-engine Deployments pointing at sandbox infra
- [x] 5. Create `infra/inttest/runner.yaml` — test runner Job template

## Phase 2: Seed Data
- [x] 6. Create `tests/integration/seed_sandbox.py` — deterministic seed script with fixed UUIDs for 5 companies, 10 documents, 5 trends, 5 recommendations, 3 orders, 2 positions, 2 global events, 2 competitive signals, 3 agents, trading config, portfolio snapshot
- [x] 7. Create `tests/integration/seed_minio.py` — seed MinIO buckets with sample normalized text files

## Phase 3: API Integration Tests
- [x] 8. Create `tests/integration/conftest.py` — pytest fixtures for HTTP client, base URLs, seed IDs
- [x] 9. Create `tests/integration/test_query_api.py` — tests for all 17 query API endpoints
- [x] 10. Create `tests/integration/test_registry_api.py` — tests for all 8 symbol registry endpoints
- [x] 11. Create `tests/integration/test_risk_api.py` — tests for all 4 risk engine endpoints
- [x] 12. Create `tests/integration/test_trading_api.py` — tests for all 12 trading engine endpoints
- [x] 13. Create `tests/integration/test_frontend_data_deps.py` — tests verifying every frontend page's API dependencies return valid data

## Phase 4: Profiling
- [x] 14. Create `tests/integration/profiler.py` — timing wrapper that records per-endpoint latency and produces a summary report
- [x] 15. Add profiling output to test runner (JSON report with P50/P95/P99 per endpoint, stage timings)

## Phase 5: Pipeline Runner
- [x] 16. Create `infra/inttest/run_pipeline.sh` — standalone orchestration script with CLI args (`--image-tag`, `--namespace`, `--skip-teardown`, `--results-file`), exit codes (0=pass, 1=fail, 2=infra error), JSON result output; creates namespace, deploys infra, seeds, deploys services, runs tests, collects results, tears down

## Phase 6: Documentation
- [x] 17. Add integration test section to `docs/LOCAL_DEV_SETUP.md` with instructions for running locally, CLI usage, JSON result contract, and a note that a future CI/CD pipeline spec will consume this runner
