diff --git a/conftest.py b/conftest.py index b4e1cde..a74eea4 100644 --- a/conftest.py +++ b/conftest.py @@ -1,15 +1,19 @@ # Copyright (C) 2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import pytest -pytest_plugins = ["swh.scheduler.pytest_plugin", "swh.storage.pytest_plugin"] +pytest_plugins = [ + "swh.scheduler.pytest_plugin", + "swh.storage.pytest_plugin", + "swh.loader.pytest_plugin", +] @pytest.fixture(scope="session") def swh_scheduler_celery_includes(swh_scheduler_celery_includes): return swh_scheduler_celery_includes + [ "swh.loader.mercurial.tasks", ] diff --git a/requirements-swh.txt b/requirements-swh.txt index b96d556..55c5e97 100644 --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,4 +1,4 @@ swh.model >= 0.4.0 swh.storage >= 0.10.0 swh.scheduler >= 0.0.39 -swh.loader.core >= 0.5.5 +swh.loader.core >= 0.5.9 diff --git a/swh/loader/mercurial/tests/conftest.py b/swh/loader/mercurial/tests/conftest.py index 22b0736..78e9f6c 100644 --- a/swh/loader/mercurial/tests/conftest.py +++ b/swh/loader/mercurial/tests/conftest.py @@ -1,53 +1,41 @@ # Copyright (C) 2019-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -import os -import yaml - import pytest from typing import Any, Dict @pytest.fixture def swh_loader_config(swh_storage_backend_config, tmp_path) -> Dict[str, Any]: swh_storage_backend_config["journal_writer"] = {} return { "storage": { "cls": "pipeline", "steps": [ {"cls": "filter"}, { "cls": "buffer", "min_batch_size": { "content": 10000, "content_bytes": 1073741824, "directory": 2500, "revision": 10, "release": 100, }, }, swh_storage_backend_config, ], }, "bundle_filename": "HG20_none_bundle", "cache1_size": 838860800, "cache2_size": 838860800, "clone_timeout_seconds": 2 * 3600, "reduce_effort": False, "save_data": False, "save_data_path": "", "max_content_size": 104857600, "temp_directory": str(tmp_path), } - - -@pytest.fixture -def swh_config(swh_loader_config, monkeypatch, tmp_path): - conffile = os.path.join(str(tmp_path), "loader.yml") - with open(conffile, "w") as f: - f.write(yaml.dump(swh_loader_config)) - monkeypatch.setenv("SWH_CONFIG_FILENAME", conffile) - return conffile