diff options
author | ijon <ijon@yandex-team.com> | 2022-12-06 15:50:08 +0300 |
---|---|---|
committer | ijon <ijon@yandex-team.com> | 2022-12-06 15:50:08 +0300 |
commit | a47304bb6087fabf3b7f45817ac0b25232afb5ac (patch) | |
tree | e8676787d5789abaa4b16a3a54b444a2728e553b /ydb/tests/functional/rename/conftest.py | |
parent | 9a4c3159305aa80064b7c4138f6a813a98f75b87 (diff) | |
download | ydb-a47304bb6087fabf3b7f45817ac0b25232afb5ac.tar.gz |
schemeshard, alter-extsubdomain: create hive before all other system tablets
schemeshard, alter-extsubdomain: create hive before all other system tablets
- make alter-extsubdomain a composite operation: hive creation and extsubdomain construction/altering
- create feature flag `EnableAlterDatabaseCreateHiveFirst` (default: false) to switch between old and new behavior
alter-extsubdomain now create extsubdomain's Hive first, then wait for it
coming alive and only then create other extsubdomain's system tablets
(SchemeShard, Coordinators, Mediators and SysViewProcessor).
So system tablets are emerging directly in the extsubdomain's Hive and
not in the root hive (and do not require separate migration pass).
- tests/functional/{rename,serverless,tenants}: refactor to use the common set of cluster/database fixtures
- schemeshard: move states of subdomain operations into separate header
- schemeshard: move CreateEvCreateTablet out of CreateParts
- schemeshard: make alter-extsubdomain semantics on input more strict
- schemeshard (unit)tests: add ability to check expected results also by reason
- schemeshard (unit)tests: convert TSubDomainSettings into raw literals
- schemeshard: fix typos
CreateFroceDrop -> CreateForceDrop
ListSubThee -> ListSubTree
Droping -> Dropping
Trasaction -> Transaction
Dafault -> Default
Buket -> Bucket
etc
- console: make code for {Create,Alter}Subdomain more identical
Diffstat (limited to 'ydb/tests/functional/rename/conftest.py')
-rw-r--r-- | ydb/tests/functional/rename/conftest.py | 113 |
1 files changed, 5 insertions, 108 deletions
diff --git a/ydb/tests/functional/rename/conftest.py b/ydb/tests/functional/rename/conftest.py index c8fb07b6aa4..b6c9a98e3f4 100644 --- a/ydb/tests/functional/rename/conftest.py +++ b/ydb/tests/functional/rename/conftest.py @@ -1,108 +1,5 @@ -# -*- coding: utf-8 -*- -import os -import logging -import pytest -import contextlib - -from ydb.tests.library.harness.kikimr_cluster import kikimr_cluster_factory -from ydb.tests.library.harness.kikimr_config import KikimrConfigGenerator -from ydb.tests.library.common.types import Erasure - - -logger = logging.getLogger(__name__) - - -@pytest.fixture(scope='module') -def local_cluster_configuration(): - configurator = KikimrConfigGenerator( - erasure=Erasure.NONE, - nodes=3, - n_to_select=1, - additional_log_configs={ - 'FLAT_TX_SCHEMESHARD': 7, - 'SCHEME_BOARD_POPULATOR': 4, - 'SCHEME_BOARD_SUBSCRIBER': 4, - 'TX_DATASHARD': 7, - 'CHANGE_EXCHANGE': 7, - } - ) - return configurator - - -@pytest.fixture(scope='module') -def ydb_cluster(local_cluster_configuration, request): - module_name = request.module.__name__ - - logger.info("setup ydb_cluster for %s", module_name) - - logger.info("setup ydb_cluster as local") - cluster = kikimr_cluster_factory( - configurator=local_cluster_configuration - ) - cluster.is_local_test = True - - cluster.start() - - yield cluster - - logger.info("destroy ydb_cluster for %s", module_name) - cluster.stop() - - -@pytest.fixture(scope='module') -def ydb_root(ydb_cluster): - return os.path.join("/", ydb_cluster.domain_name) - - -@pytest.fixture(scope='module') -def ydb_private_client(ydb_cluster): - return ydb_cluster.client - - -@pytest.fixture(scope='module') -def ydb_endpoint(ydb_cluster): - return "%s:%s" % (ydb_cluster.nodes[1].host, ydb_cluster.nodes[1].port) - - -@pytest.fixture(scope='function') -def extended_test_name(request): - return request.node.name - - -@contextlib.contextmanager -def ydb_database_ctx(ydb_cluster, database, timeout_seconds=300): - logger.info("setup ydb_database %s", database) - - ydb_cluster.remove_database( - database, - timeout_seconds=timeout_seconds - ) - - ydb_cluster.create_database( - database, - storage_pool_units_count={ - 'hdd': 1 - }, - timeout_seconds=timeout_seconds - ) - slots = ydb_cluster.register_and_start_slots(database, count=1) - - try: - yield database - finally: - logger.info("destroy ydb_database for %s", database) - for slot in slots: - slot.stop() - - ydb_cluster.remove_database( - database, - timeout_seconds=timeout_seconds - ) - - -@pytest.fixture(scope='function') -def ydb_database(ydb_cluster, ydb_root, extended_test_name): - database = os.path.join(ydb_root, extended_test_name.replace("[", "_").replace("]", "_")) - - with ydb_database_ctx(ydb_cluster, database): - yield database +# XXX: setting of pytest_plugins should work if specified directly in test modules +# but somehow it does not +# +# for ydb_{cluster, database, ...} fixture family +pytest_plugins = 'ydb.tests.library.harness.ydb_fixtures' |