Skip to content

Testing Strategy

Testing

The project includes a comprehensive test suite to ensure code quality and reliability.

Running Tests

Quick Test (Recommended):

python run_tests.py

Run with Coverage:

python run_tests.py --coverage

Run Only Unit Tests:

python run_tests.py --unit

Run Only Integration Tests:

python run_tests.py --integration

Run Tests in Parallel:

python run_tests.py --parallel

Manual Testing

For manual testing, you can use the provided test script:

./test_branch.sh

Test Structure

  • Unit Tests: Mock external dependencies for fast execution
  • Integration Tests: Test the full application flow
  • Error Handling: Comprehensive error scenario testing
  • Performance: Response time and resource usage testing

GitHub Actions & CI/CD

This project includes comprehensive GitHub Actions workflows for continuous integration and deployment with push protection.

Available Workflows

  1. Python CI with UV (.github/workflows/python-tests.yml)
  2. Runs tests on Python 3.12
  3. Includes security scanning and linting
  4. Generates coverage reports
  5. Uses UV for fast dependency management

  6. Branch Protection Enforcement (.github/workflows/branch-protection.yml)

  7. Monitors direct pushes to protected branches
  8. Validates pull request requirements
  9. Provides push protection

Setting Up GitHub Actions

The workflows are automatically triggered on: - Push to main, development, and feature/* branches - Pull requests targeting main or development - Weekly schedule (Sunday at midnight UTC)

Branch Protection Setup

To enable full push protection, configure branch protection rules in your repository settings:

  1. Go to SettingsBranches
  2. Add branch protection rule for main branch
  3. Enable the following:
  4. ✅ Require pull request reviews before merging
  5. ✅ Require approvals (1)
  6. ✅ Require status checks to pass:
    • Test Python 3.12 on ubuntu-latest
    • Security Scan
    • Lint and Code Quality
  7. ✅ Require branches to be up to date before merging
  8. ✅ Require linear history
  9. ✅ Include administrators

See Branch Protection Guide for detailed configuration instructions.