Skip to main content

Run parallel test configurations with log discovery and summary.

Project description

๐Ÿงช Reggie - Regression Testing Framework

A comprehensive, scalable regression testing framework with CLI and web interfaces, powered by Celery for distributed execution.

โœจ Features

  • ๐Ÿ–ฅ๏ธ CLI Interface: Easy command-line testing with reggie command
  • ๐ŸŒ Web Dashboard: Real-time monitoring with FastAPI + HTMX
  • โšก Distributed Execution: Scalable testing with Celery workers
  • ๐Ÿณ Docker Ready: Complete containerization with Docker Compose
  • ๐Ÿ“Š Monitoring: Built-in status monitoring and job tracking
  • ๐Ÿ”ง Flexible: Supports both local and distributed execution modes

๐Ÿš€ Quick Start

Installation

# Basic installation
pip install -e .

# With web interface
pip install -e .[web]

# Complete setup
pip install -e .[web,monitoring,dev]

Usage

# Start Redis (for Celery mode)
docker run -d -p 6379:6379 redis

# Run tests (multiprocessing mode)
reggie run config.yaml

# Run tests (Celery distributed mode)
reggie run config.yaml --celery

# Start workers (separate terminal)
reggie worker

# Start web interface (optional)
reggie web

# Monitor status
reggie status

Docker Deployment

# CLI-only deployment
docker-compose up -d

# Full web interface deployment
docker-compose -f docker-compose.web.yml up -d

๐Ÿ—๏ธ Architecture

Execution Modes

  1. Multiprocessing Mode (Default)

    • Direct process execution
    • No external dependencies
    • Good for single-machine setups
  2. Celery Mode (Scalable)

    • Distributed task execution
    • Redis message broker
    • Multiple worker support
    • Web interface integration

Components

  • CLI Interface: reggie command for all operations
  • Celery Workers: Distributed test execution
  • Web Dashboard: Real-time monitoring and control
  • SQLite Database: Test metadata and history
  • Redis Broker: Message queue for Celery

๐Ÿ”ง Configuration

Create a YAML configuration file:

name: "My Test Suite"
description: "Example regression tests"
output_dir: "./test_runs"
max_workers: 4
timeout: 300

tests:
  - name: "example_test"
    command: "echo 'Hello, World!'"
    expected_exit_code: 0
    timeout: 30
    description: "Simple example test"
  
  - name: "python_test"
    command: "python -c 'print(\"Success\")'"
    expected_exit_code: 0
    timeout: 60

๐Ÿ“Š Web Interface

Access the web dashboard at http://localhost:8000:

  • Dashboard: Overview of system status and recent jobs
  • Job Management: Start new test runs, monitor progress
  • Worker Status: View active Celery workers and their health
  • Configuration: Manage and validate config files

๐Ÿณ Docker

Services

  • reggie-app: Main application container
  • reggie-worker: Celery worker containers (scalable)
  • redis: Message broker
  • flower: Celery monitoring (web mode only)

Scaling

# Scale workers
docker-compose up -d --scale reggie-worker=3

# Monitor with Flower
open http://localhost:5555

๐Ÿ“ Project Structure

src/regression_testing_framework/
โ”œโ”€โ”€ cli.py                 # Main CLI interface
โ”œโ”€โ”€ celery_app.py         # Celery application setup
โ”œโ”€โ”€ test_runner.py        # Core test execution logic
โ”œโ”€โ”€ config_parser.py      # YAML configuration parsing
โ”œโ”€โ”€ database.py           # SQLite database operations
โ”œโ”€โ”€ tasks/
โ”‚   โ”œโ”€โ”€ test_execution.py # Individual test Celery tasks
โ”‚   โ””โ”€โ”€ orchestration.py  # Test suite orchestration
โ””โ”€โ”€ web/
    โ”œโ”€โ”€ main.py           # FastAPI web application
    โ”œโ”€โ”€ api/              # REST API endpoints
    โ”œโ”€โ”€ templates/        # HTML templates (HTMX)
    โ””โ”€โ”€ static/           # CSS stylesheets

๐Ÿ” Troubleshooting

Common Issues

  1. Dependencies: Run pip install -e .[web] for full functionality
  2. Redis: Ensure Redis is running on port 6379
  3. Workers: Start workers with reggie worker before using Celery mode
  4. Validation: Run python3 validate.py to check setup

Monitoring

  • CLI: reggie status for worker and job information
  • Web: Dashboard at http://localhost:8000
  • Flower: Celery monitoring at http://localhost:5555 (web mode)

๐Ÿ“ Development

Setup

# Clone and install
git clone <repository>
cd regression_testing_framework
pip install -e .[dev]

# Run tests
pytest

# Format code
black .
ruff check .

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

๐Ÿ“– Documentation

๐ŸŽฏ Use Cases

  • CI/CD Integration: Automated testing in pipelines
  • Performance Regression: Track performance over time
  • Cross-platform Testing: Distributed testing across environments
  • Load Testing: Scalable test execution with multiple workers
  • Compliance Testing: Automated regulatory compliance checks

๐Ÿ“„ License

MIT License - see LICENSE file for details.


Reggie - Making regression testing simple, scalable, and reliable! ๐Ÿš€ params: - "-c" - "import os; print('Hello from Python')" environment: - DEBUG=true

Test with timeout for long-running processes

long_running_test: base_command: python3 params: - "-c" - "import time; print('Starting long task...'); time.sleep(10); print('Task completed')" timeout: 15 # Timeout in seconds


2. **Run Tests**

Execute your tests:

```bash
reggie run -i config.yaml -o test_report.txt

For a dry run (to see what commands will be executed without running them):

reggie run -i config.yaml --dry-run

Control the number of parallel test executions:

reggie run -i config.yaml -p 8  # Run 8 tests in parallel

How It Works

  1. The framework parses your YAML configuration file
  2. Each test is executed in parallel using Python's ThreadPoolExecutor
  3. Commands are executed directly without shell wrapping for improved reliability
  4. Long-running tests can be configured with timeouts to prevent hanging
  5. Results are collected and a summary report is generated

Configuration Options

Test Configuration

Each test in your YAML file can have the following properties:

  • base_command: The executable to run (e.g., python3, /bin/bash)
  • params: List of parameters to pass to the command
  • environment: List of environment variables to set for the test
  • timeout: Maximum time in seconds before the test is terminated (optional)

Example Configuration

my_test:
  base_command: python3
  params:
    - script.py
    - --arg1=value1
    - --arg2=value2
  environment:
    - ENV_VAR1=value1
    - ENV_VAR2=value2
  timeout: 300  # 5 minutes timeout

License

This project is licensed under the terms of the LICENSE file included in the repository.

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

regression_testing_framework-0.2.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

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

regression_testing_framework-0.2.0-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file regression_testing_framework-0.2.0.tar.gz.

File metadata

File hashes

Hashes for regression_testing_framework-0.2.0.tar.gz
Algorithm Hash digest
SHA256 565b62aab7ce39b31d26ba2b677b52f13a44d3674773b169e70b83806c765e17
MD5 b55131cc4753d861aadd91a1cd244390
BLAKE2b-256 82430255bd6790149a25e10b7412f33524da6e7833b3ac4dec10a51d98d7cd2e

See more details on using hashes here.

File details

Details for the file regression_testing_framework-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for regression_testing_framework-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53712f83610186a563f7ac575cf1cf31b8135b6056cc2958b7a3fd69dd80c38c
MD5 2e2bd74243a55d4082ac7a929ef466d2
BLAKE2b-256 72ab65bc33dede0cb7bff75b19fd4088a9f2232a385b9a8e6f6377ae0579901c

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