Source: docs/guides/BACKGROUND_TEST_WATCH.md
Background Test Watch System
Continuous code quality monitoring without blocking development.
Quick Start
# Start background monitoring
./scripts/background-test-watch.sh start
# Monitor live (in separate terminal)
./scripts/monitor-test-watch.sh watch
# Stop all processes
./scripts/background-test-watch.sh stopWhat It Does
- Test Compilation - Validates test files compile correctly
- Frontend Linting - ESLint checking every 30 seconds
- Backend Linting - Python/ruff checking (if available)
- Type Checking - TypeScript type validation every 30 seconds
- Process Monitoring - Auto-restarts failed processes
- Page Load Testing - Validates all routes load without errors
Monitoring Commands
# Live dashboard (auto-refresh)
./scripts/monitor-test-watch.sh watch
# One-time status
./scripts/monitor-test-watch.sh status
# View specific logs
./scripts/monitor-test-watch.sh log test # Test logs
./scripts/monitor-test-watch.sh log lint # Frontend lint
./scripts/monitor-test-watch.sh log lint-backend # Backend lint
./scripts/monitor-test-watch.sh log type # Type check
./scripts/monitor-test-watch.sh log pages # Page testsFiles & Locations
- Scripts:
scripts/background-test-watch.sh,scripts/monitor-test-watch.sh - Logs:
logs/test-watch/*.log - Status:
logs/test-watch/status.json - PIDs:
logs/test-watch/*.pid - Results:
logs/test-watch/page-load-results.json
Integration with CI/CD
This is Process 1 of the 4-process continuous improvement system:
- Background Test Watch β This system
- Background Progressive Deploy - Uses test results for deployment
- Background Parallel Ghost Evals - 1000 concurrent user simulation
- Background Eval Cycle - AI-powered improvements
Process Recovery
All processes automatically restart if they die:
# Example:
# β Test watcher died, restarting...
# β Test watcher started (PID: 67890)NPM Scripts
Added to frontend package.json:
{
"test:watch": "npm run test:compile && npm run type-check",
"lint:watch": "while true; do npm run lint; sleep 30; done",
"type-check:watch": "while true; do npm run type-check; sleep 30; done",
"build:check": "next build --no-lint"
}System Requirements
- Node.js >= 18.0.0
- npm or yarn
- (Optional) ruff for Python linting
- (Optional) jq for enhanced JSON display
Troubleshooting
Processes not starting?
cd clients/frontend-001-nextjs-ui-grok-chat
npm installBackend linter not running?
pip install ruff
# or
uv pip install ruffLogs growing large?
# Clean old logs
find logs/test-watch -name "*.log" -mtime +7 -deleteFull Documentation
See output/reports/background-test-watch-setup.md for complete setup guide and troubleshooting.