Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/tests/conftest.py
# Copyright (C) 2019-2020 The Software Heritage developers | # Copyright (C) 2019-2021 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 | ||||
from typing import Any, Dict | from typing import Any, Dict | ||||
import pytest | import pytest | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_loader_config(swh_storage_backend_config) -> Dict[str, Any]: | def swh_storage_backend_config(swh_storage_backend_config): | ||||
swh_storage_backend_config["journal_writer"] = {} | """Basic pg storage configuration with no journal collaborator | ||||
(to avoid pulling optional dependency on clients of this fixture) | |||||
""" | |||||
return { | return { | ||||
"cls": "filter", | |||||
"storage": { | "storage": { | ||||
"cls": "pipeline", | |||||
"steps": [ | |||||
{"cls": "filter"}, | |||||
{ | |||||
"cls": "buffer", | "cls": "buffer", | ||||
"min_batch_size": { | "min_batch_size": { | ||||
"content": 10000, | "content": 10000, | ||||
"content_bytes": 1073741824, | "content_bytes": 1073741824, | ||||
"directory": 2500, | "directory": 2500, | ||||
"revision": 10, | "revision": 10, | ||||
"release": 100, | "release": 100, | ||||
}, | }, | ||||
"storage": swh_storage_backend_config, | |||||
}, | }, | ||||
swh_storage_backend_config, | } | ||||
], | |||||
}, | |||||
"check_revision": {"limit": 100, "status": False}, | @pytest.fixture | ||||
"log_db": "dbname=softwareheritage-log", | def swh_loader_config(swh_storage_backend_config) -> Dict[str, Any]: | ||||
return { | |||||
"storage": swh_storage_backend_config, | |||||
"check_revision": 100, | |||||
"temp_directory": "/tmp", | "temp_directory": "/tmp", | ||||
} | } |