Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/tests/conftest.py
# Copyright (C) 2019 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 | ||||
from swh.scheduler.tests.conftest import swh_app # noqa | from swh.scheduler.tests.conftest import swh_app # noqa | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_loader_config() -> Dict[str, Any]: | def swh_loader_config() -> Dict[str, Any]: | ||||
return { | return { | ||||
"storage": { | "storage": { | ||||
"cls": "pipeline", | "cls": "pipeline", | ||||
"steps": [ | "steps": [ | ||||
{"cls": "validate"}, | |||||
{"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, | ||||
Show All 21 Lines | def swh_config(swh_loader_config, monkeypatch, tmp_path): | ||||
return conffile | return conffile | ||||
@pytest.fixture(scope="session") | @pytest.fixture(scope="session") | ||||
def celery_includes(): | def celery_includes(): | ||||
return [ | return [ | ||||
"swh.loader.svn.tasks", | "swh.loader.svn.tasks", | ||||
] | ] | ||||
@pytest.fixture | |||||
def datadir(request): | |||||
"""Override default datadir""" | |||||
vlorentz: Could you explain why this is needed? | |||||
ardumontAuthorUnsubmitted Done Inline Actionsin comment or in here? datadir targets by default a "data" folder within the tests folder. I intend this to be "data" when i'm done refactoring ;) ardumont: in comment or in here?
datadir targets by default a "data" folder within the tests folder.
In… | |||||
vlorentzUnsubmitted Not Done Inline ActionsEither. But why not rename it now? vlorentz: Either.
But why not rename it now? | |||||
ardumontAuthorUnsubmitted Done Inline ActionsBecause that will touch other parts of the code as well. ardumont: Because that will touch other parts of the code as well.
And i'm trying to keep diff tidy for… | |||||
return os.path.join(os.path.dirname(str(request.fspath)), "resources") |
Could you explain why this is needed?