deposit_config_path = '/tmp/pytest-of-jenkins/pytest-0/test_post_deposit_with_status_0/deposit.yml'
swh_scheduler_config = {'db': "user=postgres password=xxx dbname=tests host=127.0.0.1 port=23465 options=''"}
@pytest.fixture(autouse=True)
def deposit_autoconfig(deposit_config_path, swh_scheduler_config):
"""Enforce config for deposit classes inherited from APIConfig."""
cfg = read(deposit_config_path)
if "scheduler" in cfg:
# scheduler setup: require the load-deposit tasks (already existing in
# production)
scheduler = get_scheduler(**cfg["scheduler"])
task_type = {
"type": "load-deposit",
"backend_name": "swh.loader.packages.deposit.tasks.LoadDeposit",
"description": "Load deposit task",
}
scheduler.create_task_type(task_type)
if "storage" in cfg:
# `deposit_update` tests requires the SWH_METADATA_AUTHORITY populated (matching
# production)
> storage = get_storage(**cfg["storage"])
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/conftest.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/storage/__init__.py:66: in get_storage
if not storage.check_config(**check_config):
.tox/py3/lib/python3.7/site-packages/swh/storage/metrics.py:24: in d
return f(*a, **kw)
.tox/py3/lib/python3.7/site-packages/swh/core/db/common.py:62: in _meth
return meth(self, *args, db=db, cur=cur, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/storage/postgresql/storage.py:152: in check_config
if not db.check_dbversion():
.tox/py3/lib/python3.7/site-packages/swh/storage/postgresql/db.py:1346: in check_dbversion
dbversion = self.dbversion()["version"]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.postgresql.db.Db object at 0x7f2070922860>
def dbversion(self):
with self.transaction() as cur:
> cur.execute(f"SELECT {', '.join(self.dbversion_cols)} FROM dbversion")
E psycopg2.errors.UndefinedTable: relation "dbversion" does not exist
E LINE 1: SELECT version, release, description FROM dbversion
E ^
.tox/py3/lib/python3.7/site-packages/swh/storage/postgresql/db.py:1342: UndefinedTable
TEST RESULT
TEST RESULT
- Run At
- Sep 24 2020, 5:10 PM