Skip to main content

WUP (What's Up) - Intelligent file watcher for regression testing in large projects

Project description

WUP (What's Up)

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • ๐Ÿค– LLM usage: $2.5500 (17 commits)
  • ๐Ÿ‘ค Human dev: ~$445 (4.5h @ $100/h, 30min dedup)

Generated on 2026-04-29 using openrouter/qwen/qwen3-coder-next


PyPI Version Python License

WUP (What's Up) - Intelligent file watcher for regression testing in large projects.

WUP monitors file changes and runs intelligent regression tests using a 3-layer approach:

  1. Detection Layer: File watching with heuristics
  2. Priority Layer: Quick tests of related services (3 endpoints max)
  3. Detail Layer: Full tests with blame reports (only on failure)

Features

  • ๐ŸŽฏ Intelligent Testing: Only tests related services when files change
  • โšก CPU Throttling: Respects system resources with configurable CPU limits
  • ๐Ÿ”„ 3-Layer Architecture: Quick smoke tests first, detailed tests only on failure
  • ๐Ÿ“Š Live Dashboard: Real-time status monitoring with Rich CLI
  • ๐Ÿ” Dependency Mapping: Automatic detection of files โ†’ endpoints โ†’ services
  • ๐Ÿš€ Framework Support: FastAPI, Flask, Django, Express.js, and more
  • ๐Ÿ“ Blame Reports: Detailed regression reports with file/line/commit info
  • โš™๏ธ Configuration System: Declarative configuration via wup.yaml file
  • ๐ŸŽ›๏ธ Per-Service Settings: Custom test strategies per service
  • ๐Ÿงช TestQL Integration: Native support for TestQL scenarios

Installation

# Install from source
pip install -e .

# Install with development dependencies
pip install -e ".[dev]"

Quick Start

# 1. Initialize configuration (optional)
wup init

# 2. Build dependency map (one-time setup)
wup map-deps ./my-project

# 3. Start watching for changes
wup watch ./my-project

# 4. Start with live dashboard
wup watch ./my-project --dashboard

Usage

Build Dependency Map

# Auto-detect framework
wup map-deps ./my-project

# Specify framework
wup map-deps ./my-project --framework fastapi

# Custom output file
wup map-deps ./my-project --output my-deps.json

Watch Project

# Basic watching (uses wup.yaml if present)
wup watch ./my-project

# With custom settings
wup watch ./my-project \
  --cpu-throttle 0.5 \
  --debounce 3 \
  --cooldown 600

# With live dashboard
wup watch ./my-project --dashboard

# Use specific config file
wup watch ./my-project --config custom-config.yaml

# TestQL mode
wup watch ./my-project --mode testql

# Discover endpoints from TestQL scenarios
wup testql-endpoints /path/to/scenarios --output testql-deps.json

Initialize Configuration

# Generate default wup.yaml configuration
wup init

# Generate with custom output path
wup init --output .wup.yaml

Check Status

# View dependency map status
wup status

# Custom deps file
wup status --deps my-deps.json

Architecture

3-Layer Testing Approach

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    DETECTION LAYER                          โ”‚
โ”‚  File watching with watchdog + heuristics                   โ”‚
โ”‚  Skips: .git, __pycache__, node_modules, .venv              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚ File change
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   PRIORITY LAYER                            โ”‚
โ”‚  Quick test: 3 endpoints max per service                    โ”‚
โ”‚  Duration: ~1-2 seconds                                     โ”‚
โ”‚  Result: Pass โ†’ Done, Fail โ†’ Escalate                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚ Failure
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    DETAIL LAYER                             โ”‚
โ”‚  Full test: All endpoints with blame report                 โ”‚
โ”‚  Duration: ~3-5 seconds                                     โ”‚
โ”‚  Result: Regression report with file/line/commit            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Performance Characteristics

Idle:           0.1% CPU, 10MB RAM
File change:    5s test โ†’ 2% CPU spike
Full regression: 15s test โ†’ 15% CPU spike
200+ files/min: 100 req/s โ†’ OK (throttled)

Configuration

wup.yaml Configuration File

WUP supports declarative configuration via wup.yaml (or .wup.yaml) in your project root. This allows you to define watch paths, service-specific settings, and test strategies.

Generate a default configuration:

wup init

Example wup.yaml:

project:
  name: "my-project"
  description: "My awesome project"

watch:
  # Folders to watch (supports glob patterns)
  paths:
    - "app/**"
    - "src/**"
    - "routes/**"
    - "!tests/**"         # exclusion
    - "!node_modules/**"

  # Global exclude patterns
  exclude_patterns:
    - "*.md"
    - "*.txt"
    - "migrations/**"

  # File types to watch (empty = watch all files)
  # Only changes to these file extensions will trigger tests
  file_types:
    - ".py"
    - ".ts"
    - ".jsx"

services:
  # Service configurations - simplified with auto-detection
  # If paths are empty, WUP auto-detects files by service name
  
  - name: "users-shell"
    type: "shell"
    # Auto-detects files containing "users-shell"
  
  - name: "users-web"
    type: "web"
    # Auto-detects files containing "users-web"
    # Will detect coincidence with users-shell
  
  # Or use explicit paths (old style still works)
  - name: "payments"
    paths:
      - "app/payments/**"
    type: "auto"

test_strategy:
  quick:
    debounce_s: 2
    max_queue: 5
    timeout_s: 10
  detail:
    debounce_s: 10
    max_queue: 1
    timeout_s: 30

testql:
  # TestQL-specific configuration
  scenario_dir: "scenarios/tests"
  smoke_scenario: "smoke.testql.toon.yaml"
  output_format: "json"
  extra_args:
    - "--timeout 10s"

CLI Options

Option Default Description
--config auto Path to wup.yaml config file
--cpu-throttle 0.8 CPU usage threshold (0.0-1.0)
--debounce 2 Debounce time in seconds
--cooldown 300 Test cooldown in seconds
--dashboard false Enable live dashboard
--deps deps.json Dependency map file path
--mode default Watcher mode: default or testql

Environment Variables

# Set default CPU throttle
export WUP_CPU_THROTTLE=0.5

# Set default debounce time
export WUP_DEBOUNCE=3

Visual DOM Diff

WUP optionally scans configured pages with Playwright after each successful quick test, compares the DOM structure to the previous snapshot, and reports significant changes.

Setup

pip install playwright
playwright install chromium

Configuration

visual_diff:
  enabled: true
  base_url: "http://localhost:8100"   # or leave empty and set WUP_BASE_URL env var
  base_url_env: "WUP_BASE_URL"
  delay_seconds: 5.0      # wait after file change before scanning
  max_depth: 10            # DOM snapshot depth
  pages:
    - "/health"
    - "/dashboard"
  pages_from_endpoints: true   # also scan endpoints from testql config
  threshold_added: 3           # min node additions to report as "changed"
  threshold_removed: 3
  threshold_changed: 5
  headless: true

Or set the base URL in .wup.env in the project root (not committed to git):

# .wup.env
WUP_BASE_URL=http://localhost:8100

Output

  • Snapshots โ€” .wup/visual-snapshots/<service>/<page>.json
  • Diff events โ€” .wup/visual-diffs/<service>/<page>.jsonl (appended on each change)

Visible in wup status as a "Visual DOM diffs" section.

Graceful degradation

If Playwright is not installed, the visual diff module logs a warning and skips scanning โ€” it does not break the watcher.

Web Dashboard (wup-web)

Optional FastAPI backend that receives events from WUP agents and renders a live dashboard.

Run

pip install -e wup-web/
wup-web --reload --port 8000

Open http://localhost:8000/ to see regressions, passes, anomalies, visual diffs, and health transitions in real time.

Configure agent โ†’ backend

# wup.yaml
web:
  enabled: true
  endpoint: "http://localhost:8000"
  timeout_s: 2.0

Or via env:

export WUP_WEB_ENDPOINT=http://localhost:8000

The agent fire-and-forgets REGRESSION, PASS, ANOMALY, VISUAL_DIFF, and HEALTH_TRANSITION events. Network errors never break the watcher (soft-fail).

See wup-web/README.md for full API reference and driver endpoints (DOM diff, browserless, anomaly).

Project Structure

wup/
โ”œโ”€โ”€ wup/
โ”‚   โ”œโ”€โ”€ __init__.py            # Package exports
โ”‚   โ”œโ”€โ”€ cli.py                 # CLI: watch, map-deps, status, init, testql-endpoints
โ”‚   โ”œโ”€โ”€ config.py              # Config loading/saving + .wup.env support
โ”‚   โ”œโ”€โ”€ core.py                # WupWatcher: detection, inference, scheduling
โ”‚   โ”œโ”€โ”€ dependency_mapper.py   # DependencyMapper: codebase โ†’ deps.json
โ”‚   โ”œโ”€โ”€ testql_discovery.py    # TestQLEndpointDiscovery: scenario parsing
โ”‚   โ”œโ”€โ”€ testql_watcher.py      # TestQLWatcher: scenario runner + health tracking
โ”‚   โ”œโ”€โ”€ visual_diff.py         # VisualDiffer: Playwright DOM snapshot + diff engine
โ”‚   โ”œโ”€โ”€ web_client.py          # WebClient: async HTTP event sink โ†’ wup-web
โ”‚   โ””โ”€โ”€ models/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ config.py          # Dataclasses: WupConfig, VisualDiffConfig, WebConfig...
โ”œโ”€โ”€ wup-web/                   # Optional FastAPI dashboard (separate package)
โ”‚   โ”œโ”€โ”€ wup_web/
โ”‚   โ”‚   โ”œโ”€โ”€ main.py            # FastAPI app
โ”‚   โ”‚   โ”œโ”€โ”€ routers/           # events, drivers, dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ storage.py         # EventStore (in-memory + JSONL)
โ”‚   โ”‚   โ””โ”€โ”€ templates/         # index.html dashboard
โ”‚   โ””โ”€โ”€ tests/                 # FastAPI endpoint tests (pytest + TestClient)
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_wup.py            # unit/integration tests (incl. VisualDiffer, config)
โ”‚   โ”œโ”€โ”€ test_testql_watcher.py # TestQLWatcher + VisualDiffer integration tests
โ”‚   โ”œโ”€โ”€ test_web_client.py     # WebClient + WebConfig tests
โ”‚   โ””โ”€โ”€ test_e2e.py            # end-to-end CLI tests
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ fastapi-app/           # FastAPI example project
โ”‚   โ”œโ”€โ”€ flask-app/             # Flask example project
โ”‚   โ”œโ”€โ”€ multi-service/         # Multi-service example
โ”‚   โ”œโ”€โ”€ testql_demo.py         # TestQL simulation demo
โ”‚   โ”œโ”€โ”€ testql_integration.py  # Custom TestQLWatcher + visual diff example
โ”‚   โ””โ”€โ”€ visual_diff_demo.py    # Visual DOM diff demo (no Playwright required)
โ”œโ”€โ”€ docs/
โ”‚   โ””โ”€โ”€ TESTQL_INTEGRATION.md  # TestQL integration guide
โ”œโ”€โ”€ testql-scenarios/          # Auto-generated TestQL scenarios
โ”œโ”€โ”€ pyproject.toml             # Package config (setuptools)
โ””โ”€โ”€ README.md

Development

Running Tests

# Run all tests
python3 -m pytest tests/ -v

# Run specific suite
python3 -m pytest tests/test_wup.py -v
python3 -m pytest tests/test_testql_watcher.py -v

# Run with coverage
python3 -m pytest tests/ --cov=wup

Examples

# Visual diff demo (no Playwright required)
python3 examples/visual_diff_demo.py

# With live page scan (requires playwright)
python3 examples/visual_diff_demo.py http://localhost:8100/health

# TestQL + visual diff integration
python3 examples/testql_integration.py /path/to/project

Building & Publishing

python -m build

License

Licensed under Apache-2.0.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wup-0.2.16.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wup-0.2.16-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file wup-0.2.16.tar.gz.

File metadata

  • Download URL: wup-0.2.16.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wup-0.2.16.tar.gz
Algorithm Hash digest
SHA256 4b587b1a0a9b6b10feea383cd11ece00b779ab7d98c74ea08210617a5443828c
MD5 321793634647a4e22708188b965fc7f3
BLAKE2b-256 4b70f21dc9e090ade4e084b65981c4f37fe23b178cfba3740bc22e9b672ad3f3

See more details on using hashes here.

File details

Details for the file wup-0.2.16-py3-none-any.whl.

File metadata

  • Download URL: wup-0.2.16-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wup-0.2.16-py3-none-any.whl
Algorithm Hash digest
SHA256 11d2538654f67f31c4a8f740b46dea4e268ce09cae4b7d1ed8a490e353bb5e34
MD5 370f76580e4fab12f2ed424faaaab652
BLAKE2b-256 1eca96805320ce3d355beaab3fb2e808c39694c2395938ad668a746f97527d89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page