Changeset View
Changeset View
Standalone View
Standalone View
conftest.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 | ||||
from swh.scheduler.tests.conftest import swh_app # noqa | pytest_plugins = ["swh.scheduler.pytest_plugin", "swh.storage.pytest_plugin"] | ||||
@pytest.fixture | @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": [ | ||||
Show All 28 Lines | def swh_proxy(): | ||||
"""Automatically inject this fixture in all tests to ensure no outside | """Automatically inject this fixture in all tests to ensure no outside | ||||
connection takes place. | connection takes place. | ||||
""" | """ | ||||
os.environ["http_proxy"] = "http://localhost:999" | os.environ["http_proxy"] = "http://localhost:999" | ||||
os.environ["https_proxy"] = "http://localhost:999" | os.environ["https_proxy"] = "http://localhost:999" | ||||
@pytest.fixture(scope="session") # type: ignore # expected redefinition | @pytest.fixture(scope="session") | ||||
def celery_includes(): | def swh_scheduler_celery_includes(swh_scheduler_celery_includes): | ||||
return [ | return swh_scheduler_celery_includes + [ | ||||
"swh.loader.package.archive.tasks", | "swh.loader.package.archive.tasks", | ||||
"swh.loader.package.cran.tasks", | "swh.loader.package.cran.tasks", | ||||
"swh.loader.package.debian.tasks", | "swh.loader.package.debian.tasks", | ||||
"swh.loader.package.deposit.tasks", | "swh.loader.package.deposit.tasks", | ||||
"swh.loader.package.npm.tasks", | "swh.loader.package.npm.tasks", | ||||
"swh.loader.package.pypi.tasks", | "swh.loader.package.pypi.tasks", | ||||
"swh.loader.package.nixguix.tasks", | "swh.loader.package.nixguix.tasks", | ||||
] | ] |