mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
test-db-provider: if postgres in tests, startup a bookkeeper db
FXIME: Has a edge case where if you disable the bookkeeper, it'll blowup because you've got an option that isn't present anywhere...
This commit is contained in:
@@ -17,6 +17,7 @@ from typing import Dict, List, Optional, Union
|
||||
class Sqlite3Db(object):
|
||||
def __init__(self, path: str) -> None:
|
||||
self.path = path
|
||||
self.provider = None
|
||||
|
||||
def get_dsn(self) -> None:
|
||||
"""SQLite3 doesn't provide a DSN, resulting in no CLI-option.
|
||||
@@ -59,6 +60,7 @@ class PostgresDb(object):
|
||||
def __init__(self, dbname, port):
|
||||
self.dbname = dbname
|
||||
self.port = port
|
||||
self.provider = None
|
||||
|
||||
self.conn = psycopg2.connect("dbname={dbname} user=postgres host=localhost port={port}".format(
|
||||
dbname=dbname, port=port
|
||||
|
||||
@@ -1447,6 +1447,7 @@ class NodeFactory(object):
|
||||
# Get the DB backend DSN we should be using for this test and this
|
||||
# node.
|
||||
db = self.db_provider.get_db(os.path.join(lightning_dir, TEST_NETWORK), self.testname, node_id)
|
||||
db.provider = self.db_provider
|
||||
node = self.node_cls(
|
||||
node_id, lightning_dir, self.bitcoind, self.executor, self.valgrind, db=db,
|
||||
port=port, options=options, may_fail=may_fail or expect_fail,
|
||||
|
||||
Reference in New Issue
Block a user