Skip to content

Commit

Permalink
run postgres tests in CI?
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 1, 2023
1 parent ddcfee2 commit 55b3973
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
os: [ubuntu-latest]
python-version: ["3.10.4"]
poetry-version: ["1.5.1"]
db-url: ["", "postgres://cashu:cashu@localhost:5432/cashu"]
db-url: ["", "postgres://cashu:cashu@localhost:5432/test"]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
Expand Down
11 changes: 7 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ async def start_mint_init(ledger: Ledger):
await ledger.load_used_proofs()
await ledger.init_keysets()

db_file = "test_data/mint/test.sqlite3"
if os.path.exists(db_file):
os.remove(db_file)
# clear sqlite database
if not settings.mint_database.startswith("postgres"):
db_file = os.path.join(settings.mint_database, "test.sqlite3")
if os.path.exists(db_file):
os.remove(db_file)

ledger = Ledger(
db=Database("test", "test_data/mint"),
db=Database("test", settings.mint_database),
seed=settings.mint_private_key,
derivation_path=settings.mint_derivation_path,
lightning=FakeWallet(),
Expand Down

0 comments on commit 55b3973

Please sign in to comment.