mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-03 10:48:03 +08:00
Run tests in in-memory SQLite db
Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit is contained in:
@@ -98,8 +98,7 @@ class TestConfiguration(BaseConfiguration):
|
||||
BUILD_LOGS_NAME_FORMAT = "build-{id}.log"
|
||||
LOG_BACKEND = "console"
|
||||
LOG_LEVEL = "debug"
|
||||
SQLALCHEMY_DATABASE_URI = environ.get(
|
||||
"DATABASE_URI", "sqlite:///{0}".format(path.join(dbdir, "mbstest.db")))
|
||||
SQLALCHEMY_DATABASE_URI = environ.get("DATABASE_URI", "sqlite:///:memory:")
|
||||
DEBUG = True
|
||||
MESSAGING = "in_memory"
|
||||
PDC_URL = "https://pdc.fedoraproject.org/rest_api/v1"
|
||||
|
||||
@@ -109,6 +109,7 @@ def clean_database(add_platform_module=True, add_default_arches=True):
|
||||
# clean_database is usually called before a test run. So, it makes no sense
|
||||
# to keep any changes in the transaction made by previous test.
|
||||
db_session.remove()
|
||||
db_session.configure(bind=db.session.get_bind())
|
||||
|
||||
db.drop_all()
|
||||
db.create_all()
|
||||
|
||||
Reference in New Issue
Block a user