Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/tests/conftest.py
Show All 9 Lines | |||||
from typing import Any, Dict | from typing import Any, Dict | ||||
from swh.scheduler.tests.conftest import * # noqa | from swh.scheduler.tests.conftest import * # noqa | ||||
from swh.storage.tests.conftest import * # noqa | from swh.storage.tests.conftest import * # noqa | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_loader_config(swh_storage_backend_config) -> Dict[str, Any]: | def swh_loader_config(swh_storage_backend_config, tmp_path) -> Dict[str, Any]: | ||||
swh_storage_backend_config["journal_writer"] = {} | swh_storage_backend_config["journal_writer"] = {} | ||||
return { | return { | ||||
"storage": { | "storage": { | ||||
"cls": "pipeline", | "cls": "pipeline", | ||||
"steps": [ | "steps": [ | ||||
{"cls": "filter"}, | {"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, | ||||
}, | }, | ||||
}, | }, | ||||
swh_storage_backend_config, | swh_storage_backend_config, | ||||
], | ], | ||||
}, | }, | ||||
"check_revision": {"limit": 100, "status": False}, | "bundle_filename": "HG20_none_bundle", | ||||
"debug": False, | "cache1_size": 838860800, | ||||
"log_db": "dbname=softwareheritage-log", | "cache2_size": 838860800, | ||||
"clone_timeout_seconds": 2 * 3600, | |||||
"reduce_effort": False, | |||||
"save_data": False, | "save_data": False, | ||||
"save_data_path": "", | "save_data_path": "", | ||||
"temp_directory": "/tmp", | "max_content_size": 104857600, | ||||
ardumont: @vlorentz I forgot to update it in the prior diff [1] but see, it's here ;)
[1] D3440#inline… | |||||
"temp_directory": str(tmp_path), | |||||
} | } | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_config(swh_loader_config, monkeypatch, tmp_path): | def swh_config(swh_loader_config, monkeypatch, tmp_path): | ||||
conffile = os.path.join(str(tmp_path), "loader.yml") | conffile = os.path.join(str(tmp_path), "loader.yml") | ||||
with open(conffile, "w") as f: | with open(conffile, "w") as f: | ||||
f.write(yaml.dump(swh_loader_config)) | f.write(yaml.dump(swh_loader_config)) | ||||
Show All 18 Lines |
@vlorentz I forgot to update it in the prior diff [1] but see, it's here ;)
[1] D3440#inline-23794