Skip to content

POSDummy Integration Test

HOMEPOT's equivalent of FabSim3's FabDummy test

POSDummy is a comprehensive integration test that verifies the entire HOMEPOT infrastructure is functional. It serves as an early warning system against structural changes that could break core functionality.

Philosophy

"If you can create a site, register a device, submit a job, simulate an agent response, and verify the audit trail - then HOMEPOT works."

POSDummy follows the proven FabSim3 FabDummy pattern:

  • Fast execution (2-3 minutes)
  • Comprehensive coverage (touches all critical components)
  • Early detection (runs before expensive operations)
  • Binary result (pass/fail - no ambiguity)

What POSDummy Tests

Phase 0: Critical Imports

  • Verifies all core modules can be imported
  • Catches syntax errors and missing dependencies
  • Validates FastAPI app and critical classes exist

Phase 1: API Endpoints

  • Tests health, version, and dashboard endpoints
  • Ensures FastAPI routing is functional
  • Verifies endpoints respond appropriately

Phase 2: Database Connectivity

  • Tests database service initialization
  • Validates basic CRUD operations
  • Ensures data integrity and connectivity

Phase 3: Complete Pipeline

  • Site Management: Create and verify dummy site
  • Device Registration: Register and configure dummy device
  • Job Orchestration: Submit and track dummy job
  • Agent Simulation: Verify agent functionality
  • Audit Logging: Confirm audit trail accessibility

Phase 4: Configuration Integrity

  • Validates critical config files exist and are readable
  • Ensures package can be built and deployed
  • Checks documentation completeness

Phase 5: Package Structure

  • Verifies Python package structure is intact
  • Ensures all critical source files exist
  • Validates import paths and module organization

Usage

Command Line

# Run complete POSDummy test
./scripts/run-pos-dummy.sh

# Quick verification (fastest)
./scripts/run-pos-dummy.sh --quick

# Detailed output
./scripts/run-pos-dummy.sh --verbose

In CI/CD

POSDummy runs automatically in GitHub Actions:

  1. Main CI/CD Pipeline: Early gate after security scan
  2. Dedicated POSDummy Workflow: Manual trigger and scheduled runs
  3. Change Detection: Automatically on core file changes

Direct Test Execution

# Run via pytest
pytest backend/tests/test_pos_dummy.py -v

# Run specific phase
pytest backend/tests/test_pos_dummy.py::TestPOSDummy::test_critical_imports -v

Integration Points

CI/CD Pipeline Position

Security Scan → POSDummy Gate → Code Quality → Full Tests → Build → Deploy

POSDummy runs early to:

  • Fail fast on infrastructure issues
  • Save CI minutes on broken builds
  • Provide clear signals to developers

GitHub Actions Integration

# Manual trigger with test modes
workflow_dispatch:
  inputs:
    test_mode: [full, quick, verbose]

# Automatic triggers
push: [core file changes]
schedule: [every 6 hours]

When POSDummy Fails

Common Failure Scenarios

  1. Import Failures: Missing dependencies, syntax errors
  2. API Issues: FastAPI configuration problems, endpoint failures
  3. Database Problems: Connection issues, schema problems
  4. Configuration Issues: Missing/corrupted config files
  5. Package Structure: Broken imports, missing files

Debugging Steps

  1. Check the logs: GitHub Actions provides detailed output
  2. Run locally: ./scripts/run-pos-dummy.sh --verbose
  3. Test phases individually: Run specific test methods
  4. Verify environment: Ensure dependencies are installed

Recovery Actions

# Quick local verification
./scripts/run-pos-dummy.sh --quick

# Full diagnosis
./scripts/run-pos-dummy.sh --verbose

# Check specific component
python -c "from src.homepot import main; print('FastAPI app OK')"

Continuous Protection

Scheduled Monitoring

  • Runs every 6 hours via GitHub Actions
  • Provides continuous infrastructure health monitoring
  • Early detection of environment drift

Change Detection

  • Automatically triggers on core file modifications
  • Prevents breaking changes from reaching main branch
  • Maintains infrastructure stability

Integration Benefits

  • Fast Feedback: 2-3 minute verification vs 15+ minute full test suite
  • Clear Signals: Binary pass/fail result
  • Infrastructure Focus: Tests system integration, not unit functionality
  • Cost Effective: Saves CI minutes and developer time

Files Structure

POSDummy Implementation:
├── backend/tests/test_pos_dummy.py           # Main test implementation
├── scripts/run-pos-dummy.sh          # Command-line runner
├── .github/workflows/pos-dummy.yml   # Dedicated workflow
├── .github/workflows/ci-cd.yml       # Integrated in main pipeline
└── docs/POSDummy.md                  # This documentation

Inspired by FabSim3

POSDummy adopts the proven FabDummy pattern from FabSim3:

  • Early detection of infrastructure issues
  • Fast execution for quick feedback
  • Comprehensive coverage of critical paths
  • Repository protection against structural changes

The approach has proven effective in maintaining large-scale computational infrastructures, and POSDummy brings these benefits to HOMEPOT.


A broken build is a broken promise to your team. POSDummy keeps that promise.