diff --git a/MANIFEST.in b/MANIFEST.in index 7fac49c..fcd5ab3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include Makefile include requirements*.txt include version.txt -recursive-include swh/loader/svn/tests/resources * +recursive-include swh/loader/svn/tests/data * recursive-include swh py.typed diff --git a/swh/loader/svn/tests/conftest.py b/swh/loader/svn/tests/conftest.py index 44bc50d..d7f7fb8 100644 --- a/swh/loader/svn/tests/conftest.py +++ b/swh/loader/svn/tests/conftest.py @@ -1,68 +1,59 @@ # 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 pytest import yaml from typing import Any, Dict from swh.scheduler.tests.conftest import swh_app # noqa from swh.storage.tests.conftest import * # noqa @pytest.fixture def swh_loader_config(swh_storage_backend_config) -> 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, ], }, "check_revision": {"limit": 100, "status": False}, "debug": False, "log_db": "dbname=softwareheritage-log", "save_data": False, "save_data_path": "", "temp_directory": "/tmp", } @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 @pytest.fixture(scope="session") def celery_includes(): return [ "swh.loader.svn.tasks", ] - - -@pytest.fixture -def datadir(request): - """Override default datadir because it's named `resources` in this repository and not - `data` as expected by the default fixture. - - """ - return os.path.join(os.path.dirname(str(request.fspath)), "resources") diff --git a/swh/loader/svn/tests/resources/httthttt.tgz b/swh/loader/svn/tests/data/httthttt.tgz similarity index 100% rename from swh/loader/svn/tests/resources/httthttt.tgz rename to swh/loader/svn/tests/data/httthttt.tgz diff --git a/swh/loader/svn/tests/resources/mediawiki-repo-r407-eol-native-crlf.tgz b/swh/loader/svn/tests/data/mediawiki-repo-r407-eol-native-crlf.tgz similarity index 100% rename from swh/loader/svn/tests/resources/mediawiki-repo-r407-eol-native-crlf.tgz rename to swh/loader/svn/tests/data/mediawiki-repo-r407-eol-native-crlf.tgz diff --git a/swh/loader/svn/tests/resources/pkg-doc-linux-r10.tgz b/swh/loader/svn/tests/data/pkg-doc-linux-r10.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-doc-linux-r10.tgz rename to swh/loader/svn/tests/data/pkg-doc-linux-r10.tgz diff --git a/swh/loader/svn/tests/resources/pkg-doc-linux-r11.tgz b/swh/loader/svn/tests/data/pkg-doc-linux-r11.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-doc-linux-r11.tgz rename to swh/loader/svn/tests/data/pkg-doc-linux-r11.tgz diff --git a/swh/loader/svn/tests/resources/pkg-doc-linux-r12.tgz b/swh/loader/svn/tests/data/pkg-doc-linux-r12.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-doc-linux-r12.tgz rename to swh/loader/svn/tests/data/pkg-doc-linux-r12.tgz diff --git a/swh/loader/svn/tests/resources/pkg-gourmet-tampered-rev6-log.tgz b/swh/loader/svn/tests/data/pkg-gourmet-tampered-rev6-log.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-gourmet-tampered-rev6-log.tgz rename to swh/loader/svn/tests/data/pkg-gourmet-tampered-rev6-log.tgz diff --git a/swh/loader/svn/tests/resources/pkg-gourmet-with-edge-case-links-and-files.tgz b/swh/loader/svn/tests/data/pkg-gourmet-with-edge-case-links-and-files.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-gourmet-with-edge-case-links-and-files.tgz rename to swh/loader/svn/tests/data/pkg-gourmet-with-edge-case-links-and-files.tgz diff --git a/swh/loader/svn/tests/resources/pkg-gourmet-with-external-id.tgz b/swh/loader/svn/tests/data/pkg-gourmet-with-external-id.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-gourmet-with-external-id.tgz rename to swh/loader/svn/tests/data/pkg-gourmet-with-external-id.tgz diff --git a/swh/loader/svn/tests/data/pkg-gourmet-with-updates.tgz b/swh/loader/svn/tests/data/pkg-gourmet-with-updates.tgz new file mode 100644 index 0000000..18e3f33 Binary files /dev/null and b/swh/loader/svn/tests/data/pkg-gourmet-with-updates.tgz differ diff --git a/swh/loader/svn/tests/resources/pkg-gourmet-with-wrong-link-cases.tgz b/swh/loader/svn/tests/data/pkg-gourmet-with-wrong-link-cases.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pkg-gourmet-with-wrong-link-cases.tgz rename to swh/loader/svn/tests/data/pkg-gourmet-with-wrong-link-cases.tgz diff --git a/swh/loader/svn/tests/data/pkg-gourmet.tgz b/swh/loader/svn/tests/data/pkg-gourmet.tgz new file mode 100644 index 0000000..57c7013 Binary files /dev/null and b/swh/loader/svn/tests/data/pkg-gourmet.tgz differ diff --git a/swh/loader/svn/tests/resources/pyang-repo-r343-eol-native-mixed-lf-crlf.tgz b/swh/loader/svn/tests/data/pyang-repo-r343-eol-native-mixed-lf-crlf.tgz similarity index 100% rename from swh/loader/svn/tests/resources/pyang-repo-r343-eol-native-mixed-lf-crlf.tgz rename to swh/loader/svn/tests/data/pyang-repo-r343-eol-native-mixed-lf-crlf.tgz diff --git a/swh/loader/svn/tests/resources/pkg-gourmet-with-updates.tgz b/swh/loader/svn/tests/resources/pkg-gourmet-with-updates.tgz deleted file mode 100644 index 6478e2b..0000000 Binary files a/swh/loader/svn/tests/resources/pkg-gourmet-with-updates.tgz and /dev/null differ diff --git a/swh/loader/svn/tests/resources/pkg-gourmet.tgz b/swh/loader/svn/tests/resources/pkg-gourmet.tgz deleted file mode 100644 index 9bf6534..0000000 Binary files a/swh/loader/svn/tests/resources/pkg-gourmet.tgz and /dev/null differ