switchgear-testing

Crates.ioswitchgear-testing
lib.rsswitchgear-testing
version0.1.26
created_at2025-10-11 20:26:04.438683+00
updated_at2025-12-09 03:45:25.627771+00
descriptionCI Integration Testing Framework for Switchgear
homepagehttps://bitshock.com
repositoryhttps://github.com/bitshock-src/switchgear
max_upload_size
id1878523
size99,030
Curtis Lee Fulton (curtisleefulton)

documentation

https://github.com/bitshock-src/switchgear

README

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 --env-file ./testing.env up -d --build --wait 
    
  2. Copy environment configuration:

    cp testing/testing.env ./testing.env
    
  3. Edit testing.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
    

Docker-in-Docker CI Testing

For running tests inside a container with Docker socket access.

  1. Start services:

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

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

    cp testing/testing.env ./testing.env
    
  4. Run tests:

    cargo test
    
Commit count: 20

cargo fmt