Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/pytest_plugin.py
# Copyright (C) 2019-2020 The Software Heritage developers | # Copyright (C) 2019-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import os | import os | ||||
import pytest | import pytest | ||||
import yaml | import yaml | ||||
from typing import Any, Dict | from typing import Any, Dict | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage_backend_config(postgresql_proc, swh_storage_postgresql): | |||||
"""Override storage configuration to not specify the journal part (and prevents the | |||||
optional journal dependency) | |||||
""" | |||||
yield { | |||||
"cls": "local", | |||||
"db": "postgresql://{user}@{host}:{port}/{dbname}".format( | |||||
host=postgresql_proc.host, | |||||
port=postgresql_proc.port, | |||||
user="postgres", | |||||
dbname="tests", | |||||
), | |||||
"objstorage": {"cls": "memory", "args": {}}, | |||||
} | |||||
@pytest.fixture | |||||
def swh_loader_config(swh_storage_postgresql) -> Dict[str, Any]: | def swh_loader_config(swh_storage_postgresql) -> Dict[str, Any]: | ||||
return { | return { | ||||
"storage": { | "storage": { | ||||
"cls": "pipeline", | "cls": "pipeline", | ||||
"steps": [ | "steps": [ | ||||
{"cls": "retry"}, | {"cls": "retry"}, | ||||
{"cls": "filter"}, | {"cls": "filter"}, | ||||
{"cls": "buffer"}, | {"cls": "buffer"}, | ||||
Show All 31 Lines |