-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CLN regtest to integration tests
- Loading branch information
1 parent
11a547e
commit 2b0dd33
Showing
16 changed files
with
262 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,68 +15,91 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
max-parallel: 1 | ||
matrix: | ||
python-version: ["3.11.6", "3.12"] | ||
lnd-version: ["v0.17.0-beta","v0.17.1-beta.rc1"] | ||
python-version: ["3.11.6"] #, "3.12"] | ||
ln-vendor: ["LND", "CLN"] | ||
lnd-version: ["v0.17.0-beta"] #,"v0.17.1-beta.rc1"] | ||
cln-version: ["v23.08.1"] | ||
bitcoind-version: ["24.0.1-alpine"] | ||
|
||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Compose Eegtest Orchestration' | ||
- name: 'Compose Regtest Orchestration' | ||
uses: isbang/[email protected] | ||
with: | ||
compose-file: "docker-test.yml" | ||
env: "tests/compose.env" | ||
compose-file: "./docker-tests.yml" | ||
down-flags: "--volumes" | ||
services: | | ||
bitcoind | ||
postgres | ||
redis | ||
coordinator-lnd | ||
coordinator-cln | ||
robot-lnd | ||
env: | ||
LND_TAG: ${{ matrix.lnd-version }} | ||
CLN_TAG: ${{ matrix.cln-version }} | ||
BITCOIND_TAG: ${{ matrix.bitcoind-version }} | ||
ROBOSATS_ENVS_FILE: ".env-sample" | ||
|
||
# - name: 'Set up Python ${{ matrix.python-version }}' | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: ${{ matrix.python-version }} | ||
- name: 'Set up Python ${{ matrix.python-version }}' | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
|
||
# - name: 'Cache pip dependencies' | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: ~/.cache/pip | ||
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-pip-dev-${{ hashFiles('**/requirements_dev.txt') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-pip- | ||
|
||
# - name: 'Install Python Dependencies' | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install -r requirements.txt | ||
# pip install -r requirements_dev.txt | ||
|
||
# - name: 'Install LND/CLN gRPC Dependencies' | ||
# run: bash ./scripts/generate_grpc.sh | ||
- name: 'Install Python Dependencies' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r requirements_dev.txt | ||
# - name: 'Create .env File' | ||
# run: | | ||
# mv .env-sample .env | ||
# sed -i "s/USE_TOR=True/USE_TOR=False/" .env | ||
- name: 'Install LND/CLN gRPC Dependencies' | ||
run: bash ./scripts/generate_grpc.sh | ||
|
||
# - name: 'Wait for PostgreSQL to become ready' | ||
# run: | | ||
# sudo apt-get install -y postgresql-client | ||
# until pg_isready -h localhost -p 5432 -U postgres; do sleep 2; done | ||
- name: 'Create .env File' | ||
run: mv .env-sample .env | ||
|
||
- name: 'Run tests with coverage' | ||
- name: 'Print CLN status' | ||
run: | | ||
docker exec coordinator coverage run manage.py test | ||
docker exec coordinator coverage report | ||
docker logs --tail 200 coordinator-cln | ||
sudo ls /var/lib/docker/volumes/robosats_cln/_data/regtest/ | ||
- name: 'Copy credentials' | ||
run: | | ||
mkdir -p ./node/cln/regtest | ||
mkdir -p ./node/lnd/data/chain/bitcoin/regtest | ||
sudo cp /var/lib/docker/volumes/robosats_lnd/_data/tls.cert ./node/lnd/tls.cert | ||
sudo cp /var/lib/docker/volumes/robosats_lnd/_data/data/chain/bitcoin/regtest/admin.macaroon ./node/lnd/data/chain/bitcoin/regtest/admin.macaroon | ||
sudo cp /var/lib/docker/volumes/robosats_cln/_data/regtest/client.pem ./node/cln/regtest/client.pem | ||
sudo cp /var/lib/docker/volumes/robosats_cln/_data/regtest/client-key.pem ./node/cln/regtest/client-key.pem | ||
sudo cp /var/lib/docker/volumes/robosats_cln/_data/regtest/server.pem ./node/cln/regtest/server.pem | ||
sudo chmod -R ./node/cln/regtest*.pem | ||
sudo chmod -R ./node/lnd/tls.cert | ||
sudo chmod -R ./node/lnd/data/chain/bitcoin/regtest/admin.macaroon | ||
# jobs: | ||
# test: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Run Docker Compose | ||
# run: | | ||
# docker-compose up -d | ||
# docker-compose run web python manage.py test | ||
- name: 'Run tests with coverage' | ||
run: | | ||
coverage run manage.py test | ||
coverage report | ||
env: | ||
LNVENDOR: ${{ matrix.ln-vendor }} | ||
DEVELOPMENT: True | ||
USE_TOR: False | ||
MACAROON_PATH: 'data/chain/bitcoin/regtest/admin.macaroon' | ||
CLN_DIR: './node/cln/regtest/' | ||
LND_DIR: './node/lnd/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ omit = [ | |
# omit test and mocks from coverage reports | ||
"tests/*", | ||
"*mocks*", | ||
"manage.py", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
coverage==7.3.2 | ||
black==23.3.0 | ||
isort==5.12.0 | ||
flake8==6.1.0 | ||
pyflakes==3.1.0 | ||
coverage==7.3.2 | ||
drf-openapi-tester==2.3.3 | ||
pre-commit==3.5.0 |
Oops, something went wrong.