Skip to content

Commit

Permalink
Skip s3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadhamzasajjad committed Apr 23, 2024
1 parent 2c022c7 commit b1133a8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 21 deletions.
28 changes: 17 additions & 11 deletions python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
AZURE_TESTS_MARK,
MONGO_TESTS_MARK,
REAL_S3_TESTS_MARK,
S3_TESTS_MARK,
S3_SSL_TEST_ENABLED,
)

Expand Down Expand Up @@ -106,19 +107,24 @@ def lmdb_storage(tmp_path):
yield f


@pytest.fixture(scope="session")
@pytest.fixture(scope="session", params=[pytest.param(1, marks=S3_TESTS_MARK)])
def s3_storage_factory():
with MotoS3StorageFixtureFactory(use_ssl=S3_SSL_TEST_ENABLED) as f:
yield f


@pytest.fixture(scope="session")
@pytest.fixture(scope="session", params=[pytest.param(1, marks=S3_TESTS_MARK)])
def s3_no_ssl_storage_factory():
with MotoS3StorageFixtureFactory(use_ssl=False) as f:
yield f


@pytest.fixture
@pytest.fixture(
scope="function",
params=[
pytest.param("s3_storage_factory", marks=S3_TESTS_MARK),
],
)
def s3_storage(s3_storage_factory):
with s3_storage_factory.create_fixture() as f:
yield f
Expand Down Expand Up @@ -197,7 +203,7 @@ def mem_storage():
@pytest.fixture(
scope="function",
params=[
"s3",
pytest.param("s3", marks=S3_TESTS_MARK),
"lmdb",
"mem",
pytest.param("azurite", marks=AZURE_TESTS_MARK),
Expand All @@ -215,7 +221,7 @@ def arctic_client(request, encoding_version):
@pytest.fixture(
scope="function",
params=[
"s3",
pytest.param("s3", marks=S3_TESTS_MARK),
"mem",
pytest.param("azurite", marks=AZURE_TESTS_MARK),
pytest.param("mongo", marks=MONGO_TESTS_MARK),
Expand Down Expand Up @@ -353,7 +359,7 @@ def mongo_version_store(mongo_store_factory):
@pytest.fixture(
scope="function",
params=[
"s3_store_factory",
pytest.param("s3_store_factory", marks=S3_TESTS_MARK),
pytest.param("azure_store_factory", marks=AZURE_TESTS_MARK),
pytest.param("real_s3_store_factory", marks=REAL_S3_TESTS_MARK),
],
Expand Down Expand Up @@ -386,7 +392,7 @@ def object_version_store_prune_previous(object_store_factory):


@pytest.fixture(
scope="function", params=["s3_store_factory", pytest.param("azure_store_factory", marks=AZURE_TESTS_MARK)]
scope="function", params=[pytest.param("s3_store_factory", marks=S3_TESTS_MARK), pytest.param("azure_store_factory", marks=AZURE_TESTS_MARK)]
)
def local_object_store_factory(request):
"""
Expand Down Expand Up @@ -781,8 +787,8 @@ def lmdb_version_store_static_and_dynamic(request):
params=(
"lmdb_version_store_v1",
"lmdb_version_store_v2",
"s3_version_store_v1",
"s3_version_store_v2",
pytest.param("s3_version_store_v1", marks=S3_TESTS_MARK),
pytest.param("s3_version_store_v2", marks=S3_TESTS_MARK),
"in_memory_version_store",
pytest.param("azure_version_store", marks=AZURE_TESTS_MARK),
pytest.param("mongo_version_store", marks=MONGO_TESTS_MARK),
Expand All @@ -801,8 +807,8 @@ def object_and_mem_and_lmdb_version_store(request):
params=(
"lmdb_version_store_dynamic_schema_v1",
"lmdb_version_store_dynamic_schema_v2",
"s3_version_store_dynamic_schema_v1",
"s3_version_store_dynamic_schema_v2",
pytest.param("s3_version_store_dynamic_schema_v1", marks=S3_TESTS_MARK),
pytest.param("s3_version_store_dynamic_schema_v2", marks=S3_TESTS_MARK),
"in_memory_version_store_dynamic_schema",
pytest.param("azure_version_store_dynamic_schema", marks=AZURE_TESTS_MARK),
pytest.param("real_s3_version_store_dynamic_schema", marks=REAL_S3_TESTS_MARK),
Expand Down
6 changes: 3 additions & 3 deletions python/tests/integration/arcticdb/test_arctic.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
ArcticInvalidApiUsageException,
)

from tests.util.mark import AZURE_TESTS_MARK, MONGO_TESTS_MARK, REAL_S3_TESTS_MARK, S3_SSL_TESTS_MARK
from tests.util.mark import S3_TESTS_MARK, AZURE_TESTS_MARK, MONGO_TESTS_MARK, REAL_S3_TESTS_MARK, S3_SSL_TESTS_MARK

class ParameterDisplayStatus(Enum):
NOT_SHOW = 1
Expand Down Expand Up @@ -835,7 +835,7 @@ def test_segment_slicing(arctic_client):
assert num_data_segments == math.ceil(rows / rows_per_segment) * math.ceil(columns / columns_per_segment)


@pytest.mark.parametrize("fixture", ["s3_storage", pytest.param("azurite_storage", marks=AZURE_TESTS_MARK)])
@pytest.mark.parametrize("fixture", [pytest.param("s3_storage", marks=S3_TESTS_MARK), pytest.param("azurite_storage", marks=AZURE_TESTS_MARK)])
def test_reload_symbol_list(fixture, request):
storage_fixture: StorageFixture = request.getfixturevalue(fixture)

Expand Down Expand Up @@ -873,7 +873,7 @@ def get_symbol_list_keys():
@pytest.mark.parametrize(
"fixture",
[
"s3_storage",
pytest.param("s3_storage", marks=S3_TESTS_MARK),
pytest.param("azurite_storage", marks=AZURE_TESTS_MARK),
pytest.param("mongo_storage", marks=MONGO_TESTS_MARK),
pytest.param("real_s3_storage", marks=REAL_S3_TESTS_MARK),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
ArcticInvalidApiUsageException,
)

from tests.util.mark import AZURE_TESTS_MARK, MONGO_TESTS_MARK, REAL_S3_TESTS_MARK
from tests.util.mark import S3_TESTS_MARK, AZURE_TESTS_MARK, MONGO_TESTS_MARK, REAL_S3_TESTS_MARK

from arcticdb.options import ModifiableEnterpriseLibraryOption, ModifiableLibraryOption

Expand Down Expand Up @@ -374,7 +374,7 @@ def add_path_prefix(uri, prefix):
@pytest.mark.parametrize(
"fixture",
[
"s3_storage",
pytest.param("s3_storage", marks=S3_TESTS_MARK),
pytest.param("azurite_storage", marks=AZURE_TESTS_MARK),
pytest.param("real_s3_storage", marks=REAL_S3_TESTS_MARK),
],
Expand Down Expand Up @@ -413,7 +413,7 @@ def test_separation_between_libraries_with_prefixes(fixture, request):
ac_mars.delete_library("pytest_test_lib_2")


@pytest.mark.parametrize("fixture", ["s3_storage", pytest.param("azurite_storage", marks=AZURE_TESTS_MARK)])
@pytest.mark.parametrize("fixture", [pytest.param("s3_storage", marks=S3_TESTS_MARK), pytest.param("azurite_storage", marks=AZURE_TESTS_MARK)])
def test_library_management_path_prefix(fixture, request):
storage_fixture: StorageFixture = request.getfixturevalue(fixture)
uri = add_path_prefix(storage_fixture.arctic_uri, "hello/world")
Expand Down
4 changes: 2 additions & 2 deletions python/tests/integration/arcticdb/test_arctic_move_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from arcticdb.util.test import assert_frame_equal
from arcticdb.exceptions import LmdbMapFullError

from tests.util.mark import AZURE_TESTS_MARK
from tests.util.mark import S3_TESTS_MARK, AZURE_TESTS_MARK


@pytest.fixture()
Expand All @@ -21,7 +21,7 @@ class Dummy:

@pytest.mark.parametrize(
"storage_type, host_attr",
[("lmdb", "db_dir"), ("s3", "bucket"), pytest.param("azurite", "container", marks=AZURE_TESTS_MARK)],
[("lmdb", "db_dir"), pytest.param("s3", "bucket", marks=S3_TESTS_MARK), pytest.param("azurite", "container", marks=AZURE_TESTS_MARK)],
)
def test_move_storage(storage_type, host_attr, request):
storage_factory = request.getfixturevalue(storage_type + "_storage_factory")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
)
from tests.util.date import DateRange

from tests.util.mark import S3_TESTS_MARK, AZURE_TESTS_MARK, MONGO_TESTS_MARK, REAL_S3_TESTS_MARK

@pytest.fixture()
def symbol():
Expand Down Expand Up @@ -450,8 +451,8 @@ def test_negative_cases(basic_store, symbol):
"lmdb_version_store_v1",
"lmdb_version_store_v2",
"lmdb_version_store_no_symbol_list",
"s3_version_store_v1",
"s3_version_store_v2",
pytest.param("s3_version_store_v1", marks=S3_TESTS_MARK),
pytest.param("s3_version_store_v2", marks=S3_TESTS_MARK)
],
)
def test_list_symbols_regex(request, lib_type):
Expand Down
1 change: 1 addition & 0 deletions python/tests/util/mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"""Mark on tests using the real (i.e. hosted by AWS as opposed to moto) S3.
Currently controlled by the ARCTICDB_PERSISTENT_STORAGE_TESTS and ARCTICDB_FAST_TESTS_ONLY env vars."""

S3_TESTS_MARK = pytest.mark.skip

"""Windows and MacOS have different handling of self-signed CA cert for test.
TODO: https://github.com/man-group/ArcticDB/issues/1394"""
Expand Down

0 comments on commit b1133a8

Please sign in to comment.