diff --git a/ydb/tests/functional/tenants/conftest.py b/ydb/tests/functional/tenants/conftest.py index 116a23f68e83..a663e73450d2 100644 --- a/ydb/tests/functional/tenants/conftest.py +++ b/ydb/tests/functional/tenants/conftest.py @@ -7,7 +7,7 @@ # but somehow it does not # # for ydb_{cluster, database, ...} fixture family -pytest_plugins = 'ydb.tests.library.fixtures' +pytest_plugins = ['ydb.tests.library.fixtures', 'ydb.tests.library.flavours'] @pytest.fixture(scope='module') diff --git a/ydb/tests/functional/tenants/test_users_groups_with_acl.py b/ydb/tests/functional/tenants/test_users_groups_with_acl.py index 0b4fa9544913..9ada01f145e6 100644 --- a/ydb/tests/functional/tenants/test_users_groups_with_acl.py +++ b/ydb/tests/functional/tenants/test_users_groups_with_acl.py @@ -19,8 +19,8 @@ def domain_login_only(request): @pytest.fixture(scope='module') -def ydb_configurator(ydb_cluster_configuration, domain_login_only): - config_generator = KikimrConfigGenerator(**ydb_cluster_configuration) +def ydb_configurator(ydb_cluster_configuration, domain_login_only, ydb_flavour_path): + config_generator = KikimrConfigGenerator(binary_paths=[ydb_flavour_path], **ydb_cluster_configuration) config_generator.yaml_config['auth_config'] = { 'domain_login_only': domain_login_only, } diff --git a/ydb/tests/functional/tenants/ya.make b/ydb/tests/functional/tenants/ya.make index c8fee7f05c0c..e2e843c496de 100644 --- a/ydb/tests/functional/tenants/ya.make +++ b/ydb/tests/functional/tenants/ya.make @@ -19,6 +19,8 @@ TEST_SRCS( SPLIT_FACTOR(20) +INCLUDE(${ARCADIA_ROOT}/ydb/tests/library/flavours/flavours_deps.inc) + DEPENDS( ydb/apps/ydbd ) @@ -27,6 +29,7 @@ PEERDIR( contrib/python/requests ydb/tests/library ydb/tests/library/fixtures + ydb/tests/library/flavours ydb/tests/library/clients ydb/tests/oss/ydb_sdk_import ydb/public/sdk/python diff --git a/ydb/tests/library/flavours/__init__.py b/ydb/tests/library/flavours/__init__.py new file mode 100644 index 000000000000..6c16636ccad4 --- /dev/null +++ b/ydb/tests/library/flavours/__init__.py @@ -0,0 +1,24 @@ +import os + +import yatest +import pytest + +FLAVOUR_TO_PATH = {} + +_PREFIX = "YDB_FLAVOUR_" + +for key, value in os.environ.items(): + if key.startswith(_PREFIX): + new_key = key[len(_PREFIX):] + FLAVOUR_TO_PATH[new_key] = value + +if not FLAVOUR_TO_PATH: + raise RuntimeError("Flavours not found. Did you forget to include 'tests/library/flavours/flavours_deps.inc' in ya.make?") + + +@pytest.fixture(scope='module', params=FLAVOUR_TO_PATH.values(), ids=FLAVOUR_TO_PATH.keys()) +def ydb_flavour_path(request): + """ + This fixture is a way to test different ydb flavours in one parametrized test + """ + return yatest.common.binary_path(request.param) diff --git a/ydb/tests/library/flavours/flavours_deps.inc b/ydb/tests/library/flavours/flavours_deps.inc new file mode 100644 index 000000000000..7c5c493c54b6 --- /dev/null +++ b/ydb/tests/library/flavours/flavours_deps.inc @@ -0,0 +1,9 @@ +DEPENDS( + ydb/apps/ydbd +) + +ENV(YDB_FLAVOUR_YDB="ydb/apps/ydbd/ydbd") + +IF (NOT OPENSOURCE) + INCLUDE(${ARCADIA_ROOT}/kikimr/tests/flavours/flavours_deps.inc) +ENDIF() diff --git a/ydb/tests/library/flavours/ya.make b/ydb/tests/library/flavours/ya.make new file mode 100644 index 000000000000..1109bd882c20 --- /dev/null +++ b/ydb/tests/library/flavours/ya.make @@ -0,0 +1,7 @@ +PY3_LIBRARY() + +PY_SRCS( + __init__.py +) + +END() diff --git a/ydb/tests/library/ya.make b/ydb/tests/library/ya.make index 320e545d3e14..2b36b7ac6454 100644 --- a/ydb/tests/library/ya.make +++ b/ydb/tests/library/ya.make @@ -107,6 +107,7 @@ END() RECURSE( compatibility clients + flavours serializability test_meta wardens