Background Test Watch System

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 stop

What It Does

  1. Test Compilation - Validates test files compile correctly
  2. Frontend Linting - ESLint checking every 30 seconds
  3. Backend Linting - Python/ruff checking (if available)
  4. Type Checking - TypeScript type validation every 30 seconds
  5. Process Monitoring - Auto-restarts failed processes
  6. 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 tests

Files & 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:

  1. Background Test Watch ← This system
  2. Background Progressive Deploy - Uses test results for deployment
  3. Background Parallel Ghost Evals - 1000 concurrent user simulation
  4. 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 install

Backend linter not running?

pip install ruff
# or
uv pip install ruff

Logs growing large?

# Clean old logs
find logs/test-watch -name "*.log" -mtime +7 -delete

Full Documentation

See output/reports/background-test-watch-setup.md for complete setup guide and troubleshooting.

Platform

Documentation

Community

Support

partnership@altsportsdata.comdev@altsportsleagues.ai

2025 Β© AltSportsLeagues.ai. Powered by AI-driven sports business intelligence.

πŸ€– AI-Enhancedβ€’πŸ“Š Data-Drivenβ€’βš‘ Real-Time