WUP (What's Up) - Intelligent file watcher for regression testing in large projects
Project description
WUP (What's Up)
AI Cost Tracking
- ๐ค LLM usage: $1.5000 (10 commits)
- ๐ค Human dev: ~$240 (2.4h @ $100/h, 30min dedup)
Generated on 2026-04-29 using openrouter/qwen/qwen3-coder-next
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:
- Detection Layer: File watching with heuristics
- Priority Layer: Quick tests of related services (3 endpoints max)
- 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.yamlfile - ๐๏ธ 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
Integration with Test Frameworks
WUP is designed to work with any test framework. The current implementation includes placeholder test methods that you can customize:
# In wup/core.py, customize these methods:
async def run_quick_test(self, service: str, endpoints: List[str]) -> bool:
# Integrate with your test framework (pytest, unittest, TestQL, etc.)
# Example:
result = subprocess.run([
"pytest", f"tests/{service}/test_smoke.py",
"--maxfail=1", "-q"
])
return result.returncode == 0
async def run_detail_test(self, service: str, endpoints: List[str]) -> Dict:
# Run full test suite with blame reporting
# Example:
result = subprocess.run([
"pytest", f"tests/{service}/",
"--cov", f"app/{service}",
"--cov-report=json"
])
return parse_coverage_report("coverage.json")
Project Structure
wup/
โโโ wup/
โ โโโ __init__.py # Package exports
โ โโโ config.py # Configuration loader
โ โโโ models/
โ โ โโโ __init__.py # Models package
โ โ โโโ config.py # Configuration dataclasses
โ โโโ core.py # WupWatcher implementation
โ โโโ dependency_mapper.py # Dependency mapping logic
โ โโโ testql_watcher.py # TestQL integration
โ โโโ cli.py # CLI interface
โโโ tests/
โ โโโ test_wup.py # Unit tests
โโโ docs/
โ โโโ 2.md # Refactoring documentation
โ โโโ 3.md # Configuration plan
โ โโโ TESTQL_INTEGRATION.md # TestQL integration docs
โโโ wup.yaml.example # Example configuration
โโโ pyproject.toml # Package configuration
โโโ README.md # This file
Development
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=wup
# Run specific test
pytest tests/test_wup.py::TestDependencyMapper::test_init
Building for Distribution
# Build wheel and source distribution
python -m build
# Install from dist
pip install dist/wup-0.1.6-py3-none-any.whl
License
Licensed under Apache-2.0.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wup-0.2.9.tar.gz.
File metadata
- Download URL: wup-0.2.9.tar.gz
- Upload date:
- Size: 40.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbc4b3f337d7e5d5c74c1ae7a25840fb1168cb21aeb5d26d978f8a24db054038
|
|
| MD5 |
f3d27dba4e62cf92e25e45c14265fee6
|
|
| BLAKE2b-256 |
fe3a312bea2859e71f8a3318ff0fd3536db6d83dbec79ab3ab1ec57234ea944b
|
File details
Details for the file wup-0.2.9-py3-none-any.whl.
File metadata
- Download URL: wup-0.2.9-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed4f684b30b4ca8ab331b12c2ae5afc6686a1422cf33d01962cfe0856a7de5e9
|
|
| MD5 |
30ec0be00726870bb8911bc068efb54a
|
|
| BLAKE2b-256 |
6abc9d6a3fc0cb85ec4836111c0d5e5995f5c789207aaee5bee846e46c003392
|