test: restructure tests (#2444)

unit, api, wallets
* only run test-api for migration
This commit is contained in:
dni ⚡ 2024-04-19 13:22:06 +02:00 committed by GitHub
parent 67fdb77339
commit e607ab7a3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 605 additions and 563 deletions

View file

@ -6,6 +6,8 @@ format: prettier black ruff
check: mypy pyright checkblack checkruff checkprettier checkbundle
test: test-unit test-wallets test-api test-regtest
prettier:
poetry run ./node_modules/.bin/prettier --write lnbits
@ -36,23 +38,32 @@ checkeditorconfig:
dev:
poetry run lnbits --reload
test:
test-wallets:
LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \
FAKE_WALLET_SECRET="ToTheMoon1" \
LNBITS_DATA_FOLDER="./tests/data" \
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest
poetry run pytest tests/wallets
test-real-wallet:
LNBITS_DATA_FOLDER="./tests/data" \
test-unit:
LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest
poetry run pytest tests/unit
test-api:
LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest tests/api
test-regtest:
PYTHONUNBUFFERED=1 \
DEBUG=true \
poetry run pytest tests/regtest
test-migration:
LNBITS_ADMIN_UI=True \
make test
make test-api
HOST=0.0.0.0 \
PORT=5002 \
LNBITS_DATA_FOLDER="./tests/data" \