πŸš€ -> Project on GitHub <-

πŸ¦™ CrawlLama Health Dashboard

πŸ“š Navigation: 🏠 Home πŸ“– Docs πŸ₯ Health Monitoring βš™οΈ Features

A comprehensive Tkinter-based test management dashboard for CrawlLama.

Features

βœ… Automatic Test Discovery - Finds all test_*.py files in the tests/ folder βœ… Single & Batch Execution - Run tests individually or all at once βœ… Live Progress Tracking - Real-time status during execution βœ… Detailed Error Logs - Complete tracebacks and error details βœ… Categorization - Tests grouped by type (Unit, Integration, OSINT, etc.) βœ… Export Functions - Export results as JSON or HTML βœ… Parallel Execution - Optionally run tests in parallel

Installation

Requirements

# Basic requirements
pip install pytest pytest-json-report pytest-timeout

# Optional for clipboard support
pip install pyperclip

Tkinter Installation

Windows & macOS: Tkinter is usually already installed with Python.

Linux:

# Ubuntu/Debian
sudo apt-get install python3-tk

# Fedora
sudo dnf install python3-tkinter

# Arch
sudo pacman -S tk

Usage

Starting the Dashboard

python health-dashboard.py

This opens the Health Dashboard GUI.

Controls

1. Test Overview

2. Status Cards (Top)

3. Control Buttons

4. Progress Panel

Shows live updates during test execution:

5. Error Log Viewer (Bottom)

Shows detailed error information:

Keyboard Shortcuts

Export Functions

JSON Export

File β†’ Export Results (JSON)

Exports complete test results in JSON format:

{
  "summary": {
    "total_tests": 15,
    "passed": 12,
    "failed": 2,
    "skipped": 1,
    "pass_rate": 80.0,
    "duration": 15.8
  },
  "results": [...],
  "failed_tests": [...],
  "category_summary": {...}
}

HTML Report

File β†’ Export Results (HTML)

Generates a clear HTML report with:

Architecture

core/health/
β”œβ”€β”€ __init__.py              # Module init
β”œβ”€β”€ dashboard.py             # Main GUI
β”œβ”€β”€ test_collector.py        # Test discovery
β”œβ”€β”€ test_runner.py           # Test execution
β”œβ”€β”€ result_parser.py         # Result parsing
└── widgets/                 # Custom widgets
    β”œβ”€β”€ test_tree.py         # TreeView for tests
    β”œβ”€β”€ status_card.py       # Status cards
    β”œβ”€β”€ progress_panel.py    # Progress bar
    └── log_viewer.py        # Error log viewer

Workflow

  1. Test Discovery
    TestCollector β†’ Finds all test_*.py β†’ Parses functions
    
  2. Test Execution
    TestRunner β†’ pytest subprocess β†’ JSON Report β†’ Result Parsing
    
  3. UI Updates
    Callback β†’ Update TreeView β†’ Update Status Cards β†’ Update Logs
    

Categorization

Tests are automatically categorized based on filenames:

Category Keywords Examples
Unit cache, llm_client, rate_limiter test_cache.py
Integration integration, web_search test_integration.py
OSINT osint, ddgs test_osint.py
Robustness robustness, error_simulation test_robustness_simple.py
Multihop multihop_reasoning test_multihop_reasoning.py

Parallel Execution

Enable β€œParallel Execution” checkbox for faster test execution:

Troubleshooting

β€œNo tests found”

# Ensure tests/ directory exists
# Windows (PowerShell)
Get-ChildItem tests\

# Linux/Mac
ls tests/

# Test discovery manually
python -c "from core.health import TestCollector; print(TestCollector().discover_tests())"

β€œpytest not found”

pip install pytest pytest-json-report

Tkinter ImportError

# Windows/macOS: Reinstall Python with tcl/tk support
# Linux: Install python3-tk (see Installation above)

Tests hang

Best Practices

  1. After Each Patch
    • Open dashboard
    • Run β€œRun All Tests”
    • Analyze errors in log viewer
  2. Before Commits
    • Make all tests green
    • Export HTML report
    • Mention report in commit message
  3. CI/CD Integration
    # Use dashboard for CI/CD reports too
    pytest --json-report --json-report-file=results.json
    # Load results.json into dashboard
    

Example Output

═══════════════════════════════════════════════
πŸ¦™ CrawlLama Health Dashboard
═══════════════════════════════════════════════

βœ… Checking dependencies...
βœ… All dependencies available

Launching Health Dashboard...
Close the window or press Ctrl+C to exit

[Dashboard GUI opens]

═══════════════════════════════════════════════
Test Results
═══════════════════════════════════════════════
Total Tests:    15
Passed:         12
Failed:         2
Skipped:        1
Pass Rate:      80.0%
Duration:       15.8s
═══════════════════════════════════════════════

Extensions

The dashboard can be easily extended:

  1. New Categories β†’ Adjust test_collector.py
  2. Custom Reports β†’ Extend result_parser.py
  3. New Widgets β†’ Add to widgets/
  4. CI/CD Integration β†’ Use JSON export

Support

If you have problems:

  1. Check pytest --version
  2. Test manual execution: pytest tests/test_example.py -v
  3. Check dashboard logs for errors
  4. GitHub Issues: Crawllama Issues
  5. Support Email: crawllama.support@protonmail.com

License

Part of the CrawlLama project Β© 2025