Skip to content

Commit d21054d

Browse files
authored
Ability to turn on/off storages during local testing (#2594)
#### Reference Issues/PRs <!--Example: Fixes #1234. See also #3456.--> #### What does this implement or fix? During local testing we need to be able to turn on and off storages, depending on our testing needs for particular features we work on. This PR makes this possible allowing each storage type to be enabled/disabled using environment variables. Some specifics: - By default if real storage is enabled, for example AWS S3 its respective simulated storage will be disabled as there is no need to do the test on simulated storage - There is ability to turn on/off all local storages but also control each one of them on their own This allows creationg of profiles - enabling such profile sets certains storages for tests and others not. Sample profile are provided in ```build_tooling/test_profiles/``` folder Another thing that is also addressed is the ability to enable disable V2 encoding the same way, for which conftest is also modified Overall mark.py is now cleaner with variables that enable the check if storage is to be used or not and skip marks that now use those variables. AWS_RUN - https://github.com/man-group/ArcticDB/actions/runs/17092948425 AWS_RUN_after comments: https://github.com/man-group/ArcticDB/actions/runs/17128174719 ------- Local storage switch on of, by default it is on: ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED Local storages, to be able to switch off individually: ARCTICDB_STORAGE_LMDB ARCTICDB_STORAGE_AZURITE ARCTICDB_STORAGE_MONGO ARCTICDB_STORAGE_MEM ARCTICDB_STORAGE_NFS ARCTICDB_STORAGE_SIM_S3 ARCTICDB_STORAGE_SIM_GCP Setting any local storage to 0 will disable it if ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED is 1, And even if ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED is 0 setting a local storage to 1 will enable it. We have also real storages like: ARCTICDB_STORAGE_AWS_S3 ARCTICDB_STORAGE_GCP ARCTICDB_STORAGE_AZURE NOTE: In order that they you have to set also ARCTICDB_PERSISTENT_STORAGE_TESTS=1. This is unlike ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED which if not set its default value is "1". Which are not grouped with local storages Also enabling real storage will disable its simulated counterpart. With encodings: ARCTICDB_TEST_ENCODING_V1 ARCTICDB_TEST_ENCODING_V2 Upon start of tests framework now prints info about storages - enabled / disabled and the also env vars for Arctic. This makes effort easy to track what storages are actually on and off and what other things are set via env vars. Example: ``` 2025-08-21 08:59:29,691 - __main__ - INFO - ------------------------------------------------------------------------------------------------------------------------ 2025-08-21 08:59:29,691 - __main__ - INFO - ARCTICDB ENVIRONMENT VARIABLES: 2025-08-21 08:59:29,691 - __main__ - INFO - ARCTICDB_REAL_S3_BUCKET=arcticdb-ci-test-bucket-02 2025-08-21 08:59:29,691 - __main__ - INFO - ARCTICDB_STORAGE_SIM_S3= 2025-08-21 08:59:29,691 - __main__ - INFO - ARCTICDB_STORAGE_LMDB= 2025-08-21 08:59:29,691 - __main__ - INFO - ARCTICDB_STORAGE_SIM_GCP= ..................................... 2025-08-21 08:59:29,691 - __main__ - INFO - ARCTICDB_STORAGE_AZURE=1 2025-08-21 08:59:29,692 - __main__ - INFO - ARCTICDB_REAL_S3_CLEAR=1 2025-08-21 08:59:29,692 - __main__ - INFO - ARCTICDB_REAL_S3_REGION=eu-west-1 2025-08-21 08:59:29,692 - __main__ - INFO - ARCTICDB_REAL_GCP_BUCKET=arcticdb-github 2025-08-21 08:59:29,692 - __main__ - INFO - ARCTICDB_PERSISTENT_STORAGE_UNIQUE_PATH_PREFIX=ci_grusev_unique 2025-08-21 08:59:29,693 - __main__ - INFO - ARCTICDB_REAL_GCP_ENDPOINT=http://storage.googleapis.com 2025-08-21 08:59:29,693 - __main__ - INFO - ------------------------------------------------------------------------------------------------------------------------ 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE STATUS: 2025-08-21 08:59:29,693 - __main__ - INFO - RUNS_ON_GITHUB =False 2025-08-21 08:59:29,693 - __main__ - INFO - LOCAL_STORAGE_TESTS_ENABLED =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_LMDB =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_MEM =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_S3 (SIMULATED) =False 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_GCP (SIMULATED) =False 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_AZURITE =False 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_NFS =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_MONGO =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_AWS_S3 =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_GCP =True 2025-08-21 08:59:29,693 - __main__ - INFO - STORAGE_AZURE =True 2025-08-21 08:59:29,693 - __main__ - INFO - Enc.V1 =True 2025-08-21 08:59:29,693 - __main__ - INFO - Enc.V2 =False 2025-08-21 08:59:29,693 - __main__ - INFO - ------------------------------------------------------------------------------------------------------------------------ ``` IMPORTANT: Although on local machines you will be able to see secrets they will be filtered out automatically during github execution by logger.py #### Any other comments? #### Checklist <details> <summary> Checklist for code changes... </summary> - [ ] Have you updated the relevant docstrings, documentation and copyright notice? - [ ] Is this contribution tested against [all ArcticDB's features](../docs/mkdocs/docs/technical/contributing.md)? - [ ] Do all exceptions introduced raise appropriate [error messages](https://docs.arcticdb.io/error_messages/)? - [ ] Are API changes highlighted in the PR description? - [ ] Is the PR labelled as enhancement or bug so it appears in autogenerated release notes? </details> <!-- Thanks for contributing a Pull Request to ArcticDB! Please ensure you have taken a look at: - ArcticDB's Code of Conduct: https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md - ArcticDB's Contribution Licensing: https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing --> --------- Co-authored-by: Georgi Rusev <Georgi Rusev>
1 parent e4bd2e2 commit d21054d

File tree

7 files changed

+213
-54
lines changed

7 files changed

+213
-54
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED=0
2+
ARCTICDB_STORAGE_LMDB=1
3+
ARCTICDB_STORAGE_AZURITE=
4+
ARCTICDB_STORAGE_MONGO=
5+
ARCTICDB_STORAGE_MEM=
6+
ARCTICDB_STORAGE_NFS=
7+
ARCTICDB_STORAGE_SIM_S3=
8+
ARCTICDB_STORAGE_SIM_GCP=
9+
10+
ARCTICDB_TEST_ENCODING_V1=1
11+
ARCTICDB_TEST_ENCODING_V2=0
12+
13+
ARCTICDB_PERSISTENT_STORAGE_TESTS=0
14+
ARCTICDB_STORAGE_AWS_S3=0
15+
ARCTICDB_STORAGE_GCP=0
16+
ARCTICDB_STORAGE_AZURE=0
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED=1
2+
ARCTICDB_STORAGE_LMDB=
3+
ARCTICDB_STORAGE_AZURITE=0
4+
ARCTICDB_STORAGE_MONGO=
5+
ARCTICDB_STORAGE_MEM=
6+
ARCTICDB_STORAGE_NFS=
7+
ARCTICDB_STORAGE_SIM_S3=0
8+
ARCTICDB_STORAGE_SIM_GCP=0
9+
10+
ARCTICDB_TEST_ENCODING_V1=1
11+
ARCTICDB_TEST_ENCODING_V2=0
12+
13+
ARCTICDB_PERSISTENT_STORAGE_TESTS=0
14+
ARCTICDB_STORAGE_AWS_S3=0
15+
ARCTICDB_STORAGE_GCP=0
16+
ARCTICDB_STORAGE_AZURE=0
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# For testing purposes when no value is set to any
2+
# local storages (including simulated must be enabled)
3+
ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED=1
4+
ARCTICDB_STORAGE_LMDB=
5+
ARCTICDB_STORAGE_AZURITE=
6+
ARCTICDB_STORAGE_MONGO=
7+
ARCTICDB_STORAGE_MEM=
8+
ARCTICDB_STORAGE_NFS=
9+
ARCTICDB_STORAGE_SIM_S3=
10+
ARCTICDB_STORAGE_SIM_GCP=
11+
12+
ARCTICDB_TEST_ENCODING_V1=
13+
ARCTICDB_TEST_ENCODING_V2=
14+
15+
ARCTICDB_PERSISTENT_STORAGE_TESTS=
16+
ARCTICDB_STORAGE_AWS_S3=
17+
ARCTICDB_STORAGE_GCP=
18+
ARCTICDB_STORAGE_AZURE=
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# In this case the simulated real storages will be skipped,
2+
# because even they are enabled, the real storages are also enabled
3+
# and then simulated will not be executed
4+
ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED=1
5+
ARCTICDB_STORAGE_LMDB=
6+
ARCTICDB_STORAGE_AZURITE=
7+
ARCTICDB_STORAGE_MONGO=
8+
ARCTICDB_STORAGE_MEM=
9+
ARCTICDB_STORAGE_NFS=
10+
ARCTICDB_STORAGE_SIM_S3=
11+
ARCTICDB_STORAGE_SIM_GCP=
12+
13+
ARCTICDB_TEST_ENCODING_V1=1
14+
ARCTICDB_TEST_ENCODING_V2=0
15+
16+
ARCTICDB_PERSISTENT_STORAGE_TESTS=1
17+
ARCTICDB_STORAGE_AWS_S3=1
18+
ARCTICDB_STORAGE_GCP=1
19+
ARCTICDB_STORAGE_AZURE=1

python/arcticdb/util/logger.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ def emit(self, record: logging.LogRecord):
2727
def sanitize_message(message: str) -> str:
2828
if (os.getenv("GITHUB_ACTIONS") == "true") and isinstance(message, str):
2929
# Use regex to find and replace sensitive access keys
30-
sanitized_message = re.sub(r'(secret=)[^\s&]+', r'\1***', message)
31-
sanitized_message = re.sub(r'(access=)[^\s&]+', r'\1***', sanitized_message)
32-
sanitized_message = re.sub(r'AccountKey=([^;]+)', r'AccountKey=***', sanitized_message)
30+
sanitized_message = message
31+
for regexp in [r'(secret=)[^\s&]+',
32+
r'(access=)[^\s&]+',
33+
r'(.*SECRET_KEY=).*$',
34+
r'(.*ACCESS_KEY=).*$',
35+
r'(.*AZURE_CONNECTION_STRING=).*$',
36+
r'(AccountKey=)([^;]+)']:
37+
sanitized_message = re.sub(regexp, r'\1***',
38+
sanitized_message, flags=re.IGNORECASE)
3339
return sanitized_message
3440
return message
3541

@@ -75,3 +81,8 @@ def __init__(self, message: str):
7581
sanitized_message = GitHubSanitizingHandler.sanitize_message(message)
7682
super().__init__(sanitized_message)
7783

84+
85+
sanitized_message = " fgy 54654 ARCTICDB_REAL_S3_SECRET_KEY=AwsB1YWasZBtonDiBcsqtz36M3m4yPl9EsiTS57w"
86+
sanitized_message = re.sub(r'(.*SECRET_KEY=).*$', r'\1***',
87+
sanitized_message, flags=re.IGNORECASE)
88+
print(sanitized_message)

python/tests/conftest.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
SIM_NFS_TESTS_MARK,
6565
SIM_S3_TESTS_MARK,
6666
REAL_GCP_TESTS_MARK,
67+
TEST_ENCODING_V1_MARK,
68+
TEST_ENCODING_V2_MARK,
6769
WINDOWS,
6870
AZURE_TESTS_MARK,
6971
MONGO_TESTS_MARK,
@@ -141,17 +143,23 @@ class EncodingVersion(enum.IntEnum):
141143
V1 = 0
142144
V2 = 1
143145

146+
# The current default encoding of ArcticDB release
147+
DEFAULT_ENCODING = EncodingVersion.V1
144148

145-
@pytest.fixture(scope="session")
146-
def only_test_encoding_version_v1():
147-
"""Dummy fixture to reference at module/class level to reduce test cases"""
149+
# endregion
150+
# region =================================== Encoding Fixtures ====================================
148151

152+
@pytest.fixture(scope="session",
153+
params=[pytest.param(DEFAULT_ENCODING, marks=TEST_ENCODING_V1_MARK)])
154+
def only_test_encoding_version_v1(request):
155+
return request.param
149156

150-
def pytest_generate_tests(metafunc):
151-
if "encoding_version" in metafunc.fixturenames:
152-
only_v1 = "only_test_encoding_version_v1" in metafunc.fixturenames
153-
metafunc.parametrize("encoding_version", [EncodingVersion.V1] if only_v1 else list(EncodingVersion))
154157

158+
@pytest.fixture(scope="session",
159+
params=[pytest.param(EncodingVersion.V1, marks=TEST_ENCODING_V1_MARK),
160+
pytest.param(EncodingVersion.V2, marks=TEST_ENCODING_V2_MARK)],)
161+
def encoding_version(request):
162+
return request.param
155163

156164
def check_local_storage_enabled():
157165
if not LOCAL_STORAGE_TESTS_ENABLED: pytest.skip("Local storage not enabled")
@@ -1497,16 +1505,3 @@ def clear_query_stats():
14971505
yield
14981506
query_stats.disable()
14991507
query_stats.reset_stats()
1500-
1501-
1502-
#region Pytest special xfail handling
1503-
1504-
def pytest_runtest_makereport(item, call):
1505-
from tests.pytest_xfail import pytest_runtest_makereport
1506-
return pytest_runtest_makereport(item, call)
1507-
1508-
def pytest_terminal_summary(terminalreporter, exitstatus):
1509-
from tests.pytest_xfail import pytest_terminal_summary
1510-
pytest_terminal_summary(terminalreporter, exitstatus)
1511-
1512-
#endregion

python/tests/util/mark.py

Lines changed: 115 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,63 +9,126 @@
99
import os
1010
import sys
1111
import pytest
12-
from typing import Union
12+
from typing import Optional, Union
1313
from datetime import date
1414
from numpy import datetime64
1515
from copy import deepcopy
1616

1717
from arcticdb.util import marks
18+
from arcticdb.util.logger import get_logger
1819

1920
MACOS = sys.platform.lower().startswith("darwin")
2021
LINUX = sys.platform.lower().startswith("linux")
2122
WINDOWS = sys.platform.lower().startswith("win32")
2223

24+
25+
# Defined shorter logs on errors
26+
SHORTER_LOGS = marks.SHORTER_LOGS
27+
logger = get_logger()
28+
29+
RUNS_ON_GITHUB = os.getenv("GITHUB_ACTIONS") == "true"
30+
31+
def getenv_strip(env_var_name: str, default_value: Optional[str] = None) -> Optional[str]:
32+
"""
33+
Get environment variable and strip whitespace safely.
34+
35+
Useful for string variables that represent enum values like "0" and "1".
36+
Returns the stripped value or the default if the variable is not set.
37+
"""
38+
value = os.getenv(env_var_name)
39+
return default_value if value is None or value.strip() == "" else value.strip()
40+
41+
2342
# TODO: Some tests are either segfaulting or failing on MacOS with conda builds.
2443
# This is meant to be used as a temporary flag to skip/xfail those tests.
2544
ARCTICDB_USING_CONDA = marks.ARCTICDB_USING_CONDA
2645
MACOS_CONDA_BUILD = ARCTICDB_USING_CONDA and MACOS
2746
MACOS_WHEEL_BUILD = not ARCTICDB_USING_CONDA and MACOS
2847

48+
# These two should become pytest marks as opposed to variables feeding into skipif
49+
PERSISTENT_STORAGE_TESTS_ENABLED = getenv_strip("ARCTICDB_PERSISTENT_STORAGE_TESTS") == "1"
50+
FAST_TESTS_ONLY = getenv_strip("ARCTICDB_FAST_TESTS_ONLY") == "1"
51+
DISABLE_SLOW_TESTS = getenv_strip("ARCTICDB_DISABLE_SLOW_TESTS") == "1"
52+
if PERSISTENT_STORAGE_TESTS_ENABLED:
53+
# This is for legacy reasons AWS has different treatment because of persistent storages test workflow at github
54+
STORAGE_AWS_S3 = getenv_strip("ARCTICDB_STORAGE_AWS_S3", "1") == "1"
55+
else:
56+
STORAGE_AWS_S3 = getenv_strip("ARCTICDB_STORAGE_AWS_S3") == "1"
57+
STORAGE_GCP = getenv_strip("ARCTICDB_STORAGE_GCP") == "1"
58+
STORAGE_AZURE = getenv_strip("ARCTICDB_STORAGE_AZURE") == "1"
59+
# Local storage tests are all LMDB, simulated and a real mongo process/service
60+
LOCAL_STORAGE_TESTS_ENABLED = getenv_strip("ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED", "1") == "1"
61+
# Each storage can be controlled individually
62+
STORAGE_LMDB = getenv_strip("ARCTICDB_STORAGE_LMDB") == "1" or (LOCAL_STORAGE_TESTS_ENABLED
63+
and getenv_strip("ARCTICDB_STORAGE_LMDB") != "0")
64+
STORAGE_AZURITE = getenv_strip("ARCTICDB_STORAGE_AZURITE") == "1" or (LOCAL_STORAGE_TESTS_ENABLED
65+
and getenv_strip("ARCTICDB_STORAGE_AZURITE") != "0")
66+
STORAGE_MONGO = getenv_strip("ARCTICDB_STORAGE_MONGO") == "1" or (LOCAL_STORAGE_TESTS_ENABLED
67+
and getenv_strip("ARCTICDB_STORAGE_MONGO") != "0")
68+
STORAGE_MEM = getenv_strip("ARCTICDB_STORAGE_MEM") == "1" or (LOCAL_STORAGE_TESTS_ENABLED
69+
and getenv_strip("ARCTICDB_STORAGE_MEM") != "0")
70+
STORAGE_NFS = getenv_strip("ARCTICDB_STORAGE_NFS") == "1" or (LOCAL_STORAGE_TESTS_ENABLED
71+
and getenv_strip("ARCTICDB_STORAGE_NFS") != "0")
72+
# When a real storage is turned on the simulated storage is turned off
73+
if STORAGE_AWS_S3:
74+
STORAGE_SIM_S3 = False
75+
else:
76+
STORAGE_SIM_S3 = (getenv_strip("ARCTICDB_STORAGE_SIM_S3") == "1"
77+
or (LOCAL_STORAGE_TESTS_ENABLED and getenv_strip("ARCTICDB_STORAGE_SIM_S3") != "0"))
78+
if STORAGE_GCP:
79+
STORAGE_SIM_GCP = False
80+
else:
81+
STORAGE_SIM_GCP = (getenv_strip("ARCTICDB_STORAGE_SIM_GCP") == "1"
82+
or (LOCAL_STORAGE_TESTS_ENABLED and getenv_strip("ARCTICDB_STORAGE_SIM_GCP") != "0"))
83+
if STORAGE_AZURE:
84+
STORAGE_AZURITE = False
85+
else:
86+
STORAGE_AZURITE = (getenv_strip("ARCTICDB_STORAGE_AZURITE") == "1"
87+
or (LOCAL_STORAGE_TESTS_ENABLED and getenv_strip("ARCTICDB_STORAGE_AZURITE") != "0"))
88+
TEST_ENCODING_V1 = getenv_strip("ARCTICDB_TEST_ENCODING_V1", "1") == "1"
89+
TEST_ENCODING_V2 = getenv_strip("ARCTICDB_TEST_ENCODING_V2", "1") == "1"
90+
91+
92+
if not SHORTER_LOGS:
93+
logger.info("-" * 120)
94+
logger.info(" ARCTICDB ENVIRONMENT VARIABLES:")
95+
for name, value in os.environ.items():
96+
if name.startswith("ARCTICDB_"):
97+
logger.info(f"{name}={value}")
98+
logger.info("-" * 120)
99+
logger.info(" STORAGE STATUS:")
100+
logger.info(f"RUNS_ON_GITHUB ={RUNS_ON_GITHUB}")
101+
logger.info(f"LOCAL_STORAGE_TESTS_ENABLED ={LOCAL_STORAGE_TESTS_ENABLED}")
102+
logger.info(f"STORAGE_LMDB ={STORAGE_LMDB}")
103+
logger.info(f"STORAGE_MEM ={STORAGE_MEM}")
104+
logger.info(f"STORAGE_S3 (SIMULATED) ={STORAGE_SIM_S3}")
105+
logger.info(f"STORAGE_GCP (SIMULATED) ={STORAGE_SIM_GCP}")
106+
logger.info(f"STORAGE_AZURITE ={STORAGE_AZURITE}")
107+
logger.info(f"STORAGE_NFS ={STORAGE_NFS}")
108+
logger.info(f"STORAGE_MONGO ={STORAGE_MONGO}")
109+
logger.info(f"PERSISTENT_STORAGE_TESTS_ENABLED ={PERSISTENT_STORAGE_TESTS_ENABLED}")
110+
logger.info(f"STORAGE_AWS_S3 ={STORAGE_AWS_S3}")
111+
logger.info(f"STORAGE_GCP ={STORAGE_GCP}")
112+
logger.info(f"STORAGE_AZURE ={STORAGE_AZURE}")
113+
logger.info(f"Enc.V1 ={TEST_ENCODING_V1}")
114+
logger.info(f"Enc.V2 ={TEST_ENCODING_V2}")
115+
logger.info("-" * 120)
116+
117+
29118
_MACOS_AZURE_TESTS_SKIP_REASON = (
30119
"Tests fail for macOS vcpkg builds, either because Azurite is improperly configured"
31120
"on the CI or because there's problem with Azure SDK for C++ in this configuration."
32121
)
33-
34122
SKIP_CONDA_MARK = pytest.mark.skipif(
35123
ARCTICDB_USING_CONDA,
36124
reason="Those tests are skipped on conda",
37125
)
38-
39-
# These two should become pytest marks as opposed to variables feeding into skipif
40-
PERSISTENT_STORAGE_TESTS_ENABLED = os.getenv("ARCTICDB_PERSISTENT_STORAGE_TESTS") == "1"
41-
FAST_TESTS_ONLY = os.getenv("ARCTICDB_FAST_TESTS_ONLY") == "1"
42-
DISABLE_SLOW_TESTS = os.getenv("ARCTICDB_DISABLE_SLOW_TESTS") == "1"
43-
# Local storage tests are all LMDB, simulated and a real mongo process/service
44-
LOCAL_STORAGE_TESTS_ENABLED = os.getenv("ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED", "1") == "1"
45-
STORAGE_LMDB = os.getenv("ARCTICDB_STORAGE_LMDB", "1") == "1" or LOCAL_STORAGE_TESTS_ENABLED == "1"
46-
STORAGE_AWS_S3 = os.getenv("ARCTICDB_STORAGE_AWS_S3", "1") == "1"
47-
STORAGE_GCP = os.getenv("ARCTICDB_STORAGE_GCP") == "1"
48-
STORAGE_AZURE = os.getenv("ARCTICDB_STORAGE_AZURE") == "1"
49-
50-
# Defined shorter logs on errors
51-
SHORTER_LOGS = marks.SHORTER_LOGS
52-
53126
# !!!!!!!!!!!!!!!!!!!!!! Below mark (variable) names should reflect where they will be used, not what they do.
54127
# This is to avoid the risk of the name becoming out of sync with the actual condition.
55128
SLOW_TESTS_MARK = pytest.mark.skipif(
56129
FAST_TESTS_ONLY or DISABLE_SLOW_TESTS, reason="Skipping test as it takes a long time to run"
57130
)
58131

59-
AZURE_TESTS_MARK = pytest.mark.skipif(
60-
FAST_TESTS_ONLY or MACOS or not LOCAL_STORAGE_TESTS_ENABLED, reason=_MACOS_AZURE_TESTS_SKIP_REASON
61-
)
62-
"""Mark to skip all Azure tests when MACOS or ARCTICDB_FAST_TESTS_ONLY is set."""
63-
64-
# Mongo tests will run under local storage tests
65-
MONGO_TESTS_MARK = pytest.mark.skipif(
66-
FAST_TESTS_ONLY or sys.platform != "linux" or not LOCAL_STORAGE_TESTS_ENABLED,
67-
reason="Skipping mongo tests under ARCTICDB_FAST_TESTS_ONLY and if local storage tests are disabled",
68-
)
69132
"""Mark on tests using the mongo storage fixtures. Currently skips if ARCTICDB_FAST_TESTS_ONLY."""
70133

71134
REAL_S3_TESTS_MARK = pytest.mark.skipif(
@@ -90,13 +153,13 @@
90153
"""Mark on tests using S3 model storage.
91154
"""
92155
SIM_S3_TESTS_MARK = pytest.mark.skipif(
93-
not LOCAL_STORAGE_TESTS_ENABLED,
156+
not STORAGE_SIM_S3,
94157
reason="Ability to disable local storages - simulates s3 is disabled",
95158
)
96159
"""Mark on tests using GCP model storage.
97160
"""
98161
SIM_GCP_TESTS_MARK = pytest.mark.skipif(
99-
not LOCAL_STORAGE_TESTS_ENABLED,
162+
not STORAGE_SIM_GCP,
100163
reason="Ability to disable local storages - simulates gcp is disabled",
101164
)
102165
"""Mark on tests using the real GCP storage.
@@ -110,18 +173,39 @@
110173
"""Mark on tests using the MEM storage.
111174
"""
112175
MEM_TESTS_MARK = pytest.mark.skipif(
113-
not LOCAL_STORAGE_TESTS_ENABLED,
176+
not STORAGE_MEM,
114177
reason="Ability to disable local storages - mem storage is disabled",
115178
)
116179
"""Mark on tests using the NFS model storage.
117180
"""
118181
SIM_NFS_TESTS_MARK = pytest.mark.skipif(
119-
not LOCAL_STORAGE_TESTS_ENABLED,
182+
not STORAGE_NFS,
120183
reason="Ability to disable local storages - simulated nfs is disabled",
121184
)
122185
"""Mark on tests using the real GCP storage.
123186
"""
187+
AZURE_TESTS_MARK = pytest.mark.skipif(
188+
FAST_TESTS_ONLY or MACOS or not STORAGE_AZURITE, reason=_MACOS_AZURE_TESTS_SKIP_REASON
189+
)
190+
"""Mark to skip all Azure tests when MACOS or ARCTICDB_FAST_TESTS_ONLY is set."""
124191

192+
# Mongo tests will run under local storage tests
193+
MONGO_TESTS_MARK = pytest.mark.skipif(
194+
FAST_TESTS_ONLY or (not LINUX) or (not STORAGE_MONGO),
195+
reason="Skipping mongo tests under ARCTICDB_FAST_TESTS_ONLY and if local storage tests are disabled",
196+
)
197+
"""Mark on tests or fixtures that need to skip V1 encoding tests
198+
"""
199+
TEST_ENCODING_V1_MARK = pytest.mark.skipif(
200+
not TEST_ENCODING_V1,
201+
reason="Ability to disable encoding tests - V1 is disabled",
202+
)
203+
"""Mark on tests or fixtures that need to skip V2 encoding tests
204+
"""
205+
TEST_ENCODING_V2_MARK = pytest.mark.skipif(
206+
not TEST_ENCODING_V2,
207+
reason="Ability to disable encoding tests - V2 is disabled",
208+
)
125209

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

0 commit comments

Comments
 (0)