switchgear-testing 0.1.11

CI Integration Testing Framework for Switchgear
Documentation

Testing

Docker-based regtest environment for testing with Lightning Network nodes (CLN, LND), Bitcoin Core, and databases.

Local Testing

  1. Start services:

    cd testing
    docker compose up -d --build --wait 
    
  2. Copy environment configuration:

    cp testing/.env .
    
  3. Edit .env and change all service names to localhost:

CLN_HOSTNAME=localhost
CREDENTIALS_SERVER_HOSTNAME=localhost
LND_HOSTNAME=localhost
MYSQL_HOSTNAME=localhost
POSTGRES_HOSTNAME=localhost
  1. Run tests:
    cargo test
    

Skip integration tests with service dependencies:

SWGR_SKIP_INTEGRATION_TESTS=true cargo test

Docker-in-Docker CI Testing

For running tests inside a container with Docker socket access.

  1. Start services:

    cd testing
    docker compose up -d --build --wait 
    
  2. Connect container to services network:

    . testing/.env
    docker network connect $SERVICES_NETWORK_NAME $(hostname)
    
  3. Copy environment configuration:

    cp testing/.env .
    
  4. Run tests:

    cargo test