Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coordinator trade pipeline end-to-end tests #934

Merged
merged 14 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ POSTGRES_HOST='127.0.0.1'
POSTGRES_PORT='5432'

# Tor proxy for remote calls (e.g. fetching prices or sending Telegram messages)
USE_TOR='True'
USE_TOR=True
TOR_PROXY='127.0.0.1:9050'

# Auto unlock LND password. Only used in development docker-compose environment.
Expand Down Expand Up @@ -166,4 +166,4 @@ MINIMUM_TARGET_CONF = 24
SLASHED_BOND_REWARD_SPLIT = 0.5

# Username for HTLCs escrows
ESCROW_USERNAME = 'admin'
ESCROW_USERNAME = 'admin'
76 changes: 0 additions & 76 deletions .github/workflows/django-test.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Test: Coordinator"

on:
workflow_dispatch:
workflow_call:
push:
branches: [ "main" ]
paths: ["api", "chat", "control", "robosats"]
pull_request_target:
branches: [ "main" ]
paths: ["api", "chat", "control", "robosats"]

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-tag: ['3.11.6-slim-bookworm', '3.12-slim-bookworm']
lnd-version: ['v0.17.0-beta'] # , 'v0.17.0-beta.rc1']
cln-version: ['v23.08.1']
ln-vendor: ['LND', 'CLN']

steps:
- name: 'Checkout'
uses: actions/checkout@v4

- name: Patch Dockerfile and .env-sample
run: |
sed -i "1s/FROM python:.*/FROM python:${{ matrix.python-tag }}/" Dockerfile
sed -i '/RUN pip install --no-cache-dir -r requirements.txt/a COPY requirements_dev.txt .\nRUN pip install --no-cache-dir -r requirements_dev.txt' Dockerfile
sed -i "s/^LNVENDOR=.*/LNVENDOR='${{ matrix.ln-vendor }}'/" .env-sample

- uses: satackey/[email protected]
continue-on-error: true
with:
key: coordinator-docker-cache-${{ hashFiles('Dockerfile', 'requirements.txt', 'requirements_dev.txt') }}
restore-keys: |
coordinator-docker-cache-

- name: 'Compose Regtest Orchestration'
uses: isbang/[email protected]
with:
compose-file: "./docker-tests.yml"
down-flags: "--volumes"
services: |
bitcoind
postgres
redis
coordinator-${{ matrix.ln-vendor }}
robot-LND
coordinator
env:
LND_VERSION: ${{ matrix.lnd-version }}
CLN_VERSION: ${{ matrix.cln-version }}
BITCOIND_VERSION: ${{ matrix.bitcoind-version }}
ROBOSATS_ENVS_FILE: ".env-sample"

- name: Wait for coordinator (django server)
run: |
while [ "$(docker inspect --format "{{.State.Health.Status}}" coordinator)" != "healthy" ]; do
echo "Waiting for coordinator to be healthy..."
sleep 5
done

- name: 'Run tests with coverage'
run: |
docker exec coordinator coverage run manage.py test
docker exec coordinator coverage report
env:
LNVENDOR: ${{ matrix.ln-vendor }}
DEVELOPMENT: True
USE_TOR: False
2 changes: 1 addition & 1 deletion .github/workflows/py-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
python-version: '3.11.6'
cache: pip
- run: pip install black==22.8.0 flake8==5.0.4 isort==5.10.1
- run: pip install requirements_dev.txt
- name: Run linters
uses: wearerequired/lint-action@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
fi


django-test:
uses: RoboSats/robosats/.github/workflows/django-test.yml@main
integration-tests:
uses: RoboSats/robosats/.github/workflows/integration-tests.yml@main
needs: check-versions

frontend-build:
Expand Down
Loading