Skip to content
Snippets Groups Projects
  1. Apr 02, 2024
  2. Mar 29, 2024
  3. Mar 25, 2024
  4. Mar 21, 2024
  5. Mar 15, 2024
  6. Mar 13, 2024
    • David Douard's avatar
      Remove empty __init__.py files · 6bd96892
      David Douard authored
      Especially the main one in swh/objstorage needs to be removed since this
      later is a namespace, in addition to being a package, in which
      swh-objstorage-replayer installs itself. So for the namespace importing
      mechanism to work properly, it must be an actual namespace (handled by
      the NamespaceLoader, not a package backed by the __init__ file).
      6bd96892
  7. Feb 06, 2024
    • David Douard's avatar
      azure: add support for using the secondary endpoint for the download_url · 8b8c3f1e
      David Douard authored
      The idea is to allow using Azure's secondary endpoint
      (BlobSecondaryEndpoint) to craft the download url the storage used as
      public download URL.
      
      This is needed for the integration test where the endpoint used to add
      content in an azure-backend objstorage is different from the public URL
      that can be used to download the blob directly from azure (azurite in the
      context of integration tests).
      8b8c3f1e
  8. Feb 05, 2024
  9. Feb 02, 2024
    • Jérémy Bobbio (Lunar)'s avatar
      Implement delete() in WineryObjStorage · ddc1b777
      Jérémy Bobbio (Lunar) authored and Nicolas Dandrimont's avatar Nicolas Dandrimont committed
      We now allow to delete objects from Winery. The object is first marked
      as deleted in the shared base. This makes it inaccessible from further
      `get()` calls. If the object still in a RWShard, the relevant line in
      the `objects` table is deleted as well.
      
      To take care of removing the data in ROShards, a dedicated host able to
      map images in read-write mode can then call:
      
          swh objstorage winery clean-deleted-objects
      
      This will zero out any deleted object present in the images and remove
      their key from the indices. Object keys will then be removed from the
      shared database.
      
      Thanks to olasd for proposing several improvements over the initial
      submission.
      
      Addresses swh-alter#4
      ddc1b777
    • Jérémy Bobbio (Lunar)'s avatar
      Switch to a state column for inflight status · 9d4d3b93
      Jérémy Bobbio (Lunar) authored and Nicolas Dandrimont's avatar Nicolas Dandrimont committed
      This paves the way to implement object deletion as another status.
      (So we can later cleanup the shards in a batch process.)
      
      Thanks to olasd for proposing several improvements over the initial
      submission.
      9d4d3b93
    • Jérémy Bobbio (Lunar)'s avatar
      Implement a file-backed image pool for Winery tests · ed2a33eb
      Jérémy Bobbio (Lunar) authored and Nicolas Dandrimont's avatar Nicolas Dandrimont committed
      As an alternative to running the tests with a Ceph backend, we
      implement an alternative image pool based on simple files.
      We represent unmapped images by setting their permissions to 0o000.
      
      The tests are modified to run with both the file-backed image pool
      and the Ceph pool. Those latter ones will be skipped if Ceph is not
      available.
      ed2a33eb
    • Nicolas Dandrimont's avatar
      Pin moto to < 5 · cf4c9c31
      Nicolas Dandrimont authored
      moto v5 rejigged the fixtures in a way that's incompatible with
      swh.objstorage, pin it down for now.
      cf4c9c31
    • Nicolas Dandrimont's avatar
  10. Jan 22, 2024
    • Jérémy Bobbio (Lunar)'s avatar
      Skip test_list_content* on cloud implementations · 2794dc8d
      Jérémy Bobbio (Lunar) authored
      Running `test_list_content*` on cloud implementations is pretty useless
      as we won’t be listing 17 billion contents from Azure or S3 in a single
      thread operation. As each one takes a minute per cloud, we skip these
      tests to improve the runtime of the test suite.
      2794dc8d
    • Jérémy Bobbio (Lunar)'s avatar
      Skip testing most compression methods by default · 0e68c84f
      Jérémy Bobbio (Lunar) authored
      The test suite is now reaching the C.I. timeout. In order to reduce the
      overall runtime, we now skip testing most compression methods (bzip2,
      zlib, lzma) in cloud objstorages by default. Testing all compression
      methods can still be done by specifying `--all-compression-methods` on
      pytest command-line.
      
      diff --git a/swh/objstorage/tests/conftest.py b/swh/objstorage/tests/conftest.py
      index 377778e..664aade 100644
      --- a/swh/objstorage/tests/conftest.py
      +++ b/swh/objstorage/tests/conftest.py
      @@ -1,5 +1,7 @@
       import sys
      
      +import pytest
      +
      
       def pytest_configure(config):
           config.addinivalue_line("markers", "shard_max_size: winery backend")
      @@ -14,6 +16,13 @@ def pytest_configure(config):
           config.addinivalue_line(
               "markers", "use_benchmark_flags: use the --winery-bench-* CLI flags"
           )
      +    config.addinivalue_line(
      +        "markers",
      +        (
      +            "all_compression_methods: "
      +            "test all compression methods instead of only the most common ones"
      +        ),
      +    )
      
       def pytest_addoption(parser):
      @@ -106,3 +115,15 @@ def pytest_addoption(parser):
               help="Maximum number of bytes per second write",
               default=100 * 1024 * 1024,
           )
      +    parser.addoption(
      +        "--all-compression-methods",
      +        action="store_true",
      +        default=False,
      +        help="Test all compression methods",
      +    )
      +
      +
      +def pytest_runtest_setup(item):
      +    if item.get_closest_marker("all_compression_methods"):
      +        if not item.config.getoption("--all-compression-methods"):
      +            pytest.skip("`--all-compression-methods` has not been specified")
      diff --git a/swh/objstorage/tests/test_objstorage_azure.py b/swh/objstorage/tests/test_objstorage_azure.py
      index b78e3d4..3679258 100644
      --- a/swh/objstorage/tests/test_objstorage_azure.py
      +++ b/swh/objstorage/tests/test_objstorage_azure.py
      @@ -269,14 +269,17 @@ class TestMockedAzureCloudObjStorageGzip(TestMockedAzureCloudObjStorage):
           compression = "gzip"
      
      +@pytest.mark.all_compression_methods
       class TestMockedAzureCloudObjStorageZlib(TestMockedAzureCloudObjStorage):
           compression = "zlib"
      
      +@pytest.mark.all_compression_methods
       class TestMockedAzureCloudObjStorageLzma(TestMockedAzureCloudObjStorage):
           compression = "lzma"
      
      +@pytest.mark.all_compression_methods
       class TestMockedAzureCloudObjStorageBz2(TestMockedAzureCloudObjStorage):
           compression = "bz2"
      
      diff --git a/swh/objstorage/tests/test_objstorage_cloud.py b/swh/objstorage/tests/test_objstorage_cloud.py
      index 49cbd62..1c50850 100644
      --- a/swh/objstorage/tests/test_objstorage_cloud.py
      +++ b/swh/objstorage/tests/test_objstorage_cloud.py
      @@ -148,6 +148,7 @@ class TestCloudObjStorage(ObjStorageTestFixture, unittest.TestCase):
               pass
      
      +@pytest.mark.all_compression_methods
       class TestCloudObjStorageBz2(TestCloudObjStorage):
           compression = "bz2"
      
      @@ -156,10 +157,12 @@ class TestCloudObjStorageGzip(TestCloudObjStorage):
           compression = "gzip"
      
      +@pytest.mark.all_compression_methods
       class TestCloudObjStorageLzma(TestCloudObjStorage):
           compression = "lzma"
      
      +@pytest.mark.all_compression_methods
       class TestCloudObjStorageZlib(TestCloudObjStorage):
           compression = "zlib"
      
      diff --git a/swh/objstorage/tests/test_objstorage_pathslicing.py b/swh/objstorage/tests/test_objstorage_pathslicing.py
      index d1f5568..72c3305 100644
      --- a/swh/objstorage/tests/test_objstorage_pathslicing.py
      +++ b/swh/objstorage/tests/test_objstorage_pathslicing.py
      @@ -8,6 +8,8 @@ import tempfile
       import unittest
       from unittest.mock import DEFAULT, patch
      
      +import pytest
      +
       from swh.model import hashutil
       from swh.objstorage import exc
       from swh.objstorage.constants import ID_DIGEST_LENGTH
      @@ -144,13 +146,16 @@ class TestPathSlicingObjStorageGzip(TestPathSlicingObjStorage):
           compression = "gzip"
      
      +@pytest.mark.all_compression_methods
       class TestPathSlicingObjStorageZlib(TestPathSlicingObjStorage):
           compression = "zlib"
      
      +@pytest.mark.all_compression_methods
       class TestPathSlicingObjStorageBz2(TestPathSlicingObjStorage):
           compression = "bz2"
      
      +@pytest.mark.all_compression_methods
       class TestPathSlicingObjStorageLzma(TestPathSlicingObjStorage):
           compression = "lzma"
      0e68c84f
  11. Jan 15, 2024
    • Antoine Lambert's avatar
      pytest: Fix tests execution in development virtual environment · 857a6d25
      Antoine Lambert authored
      Since migration to PEP 517, executing "make test" or "pytest" in the root
      directory of the objstorage package triggers the following error:
      
      ImportError: cannot import name 'add_filters' from 'swh.objstorage.multiplexer.filter'
      
      Explicitly setting the testpaths option in pytest.ini and TEST_DIRS
      variable in Makefile.local to swh/objstorage/tests fix the issue.
      857a6d25
  12. Jan 05, 2024
Loading