Skip to content

Commit 0dbb41a

Browse files
authored
Merge ab23198 into 74e259f
2 parents 74e259f + ab23198 commit 0dbb41a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+334
-313
lines changed

ydb/library/yaml_config/ut_transform/test_transform.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
import yatest
44
import pytest
5-
from ydb.tests.library.common import yatest_common
65

76
import json
87
import logging
@@ -15,7 +14,7 @@
1514

1615
def bin_from_env(name):
1716
if os.getenv(name):
18-
return yatest_common.binary_path(os.getenv(name))
17+
return yatest.common.binary_path(os.getenv(name))
1918
raise RuntimeError(f'{name} enviroment variable is not specified')
2019

2120

@@ -35,7 +34,7 @@ class TestYamlConfigTransformations(object):
3534
@classmethod
3635
def execute(cls, binary, stdin=None, args=[]):
3736
try:
38-
execution = yatest_common.execute(
37+
execution = yatest.common.execute(
3938
[binary] + args,
4039
stdin=stdin,
4140
)
@@ -50,7 +49,7 @@ def canonical_result(output_result, filename, out_path):
5049
result_path = os.path.join(out_path, result_filename)
5150
with open(result_path, "w") as f:
5251
f.write(output_result)
53-
return yatest_common.canonical_file(str(result_path), diff_tool=json_diff_bin(), local=True, universal_lines=True)
52+
return yatest.common.canonical_file(str(result_path), diff_tool=json_diff_bin(), local=True, universal_lines=True)
5453

5554
def cleanup_errors(self, errors):
5655
return re.sub(r'address -> 0x[a-zA-Z0-9]+', 'address -> REDACTED', errors)
@@ -65,7 +64,7 @@ def execute_test(self, data, binary, args=[]):
6564
success, result = self.execute(stdin=f, binary=binary, args=args)
6665
if not success:
6766
result = json.dumps({"error": True, "stderr": self.cleanup_errors(result)})
68-
results[entry.name] = self.canonical_result(result, entry.name, yatest_common.output_path())
67+
results[entry.name] = self.canonical_result(result, entry.name, yatest.common.output_path())
6968
return [results[key] for key in sorted(results.keys(), reverse=True)]
7069

7170
@pytest.mark.parametrize('binary', [('dump', dump_bin()), ('dump_ds_init', dump_ds_init_bin())], ids=lambda binary: binary[0])

ydb/public/tools/lib/cmds/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
import sys
1111
from six.moves.urllib.parse import urlparse
1212

13+
import yatest
14+
1315
from ydb.library.yql.providers.common.proto.gateways_config_pb2 import TGenericConnectorConfig
14-
from ydb.tests.library.common import yatest_common
1516
from ydb.tests.library.harness.kikimr_cluster import kikimr_cluster_factory
1617
from ydb.tests.library.harness.kikimr_config import KikimrConfigGenerator
1718
from ydb.tests.library.common.types import Erasure
@@ -56,15 +57,15 @@ def parse_erasure(args):
5657

5758

5859
def driver_path_packages(package_path):
59-
return yatest_common.build_path(
60+
return yatest.commmon.build_path(
6061
"{}/Berkanavt/kikimr/bin/kikimr".format(
6162
package_path
6263
)
6364
)
6465

6566

6667
def udfs_path_packages(package_path):
67-
return yatest_common.build_path(
68+
return yatest.commmon.build_path(
6869
"{}/Berkanavt/kikimr/libs".format(
6970
package_path
7071
)
@@ -93,7 +94,7 @@ def write_file(args, suffix, content):
9394
write_file_flushed(os.path.join(args.ydb_working_dir, suffix), content)
9495
return
9596

96-
write_file_flushed(os.path.join(yatest_common.output_path(suffix)), content)
97+
write_file_flushed(os.path.join(yatest.commmon.output_path(suffix)), content)
9798

9899
try:
99100
write_file_flushed(suffix, content)
@@ -106,7 +107,7 @@ def read_file(args, suffix):
106107
with open(os.path.join(args.ydb_working_dir, suffix), 'r') as fd:
107108
return fd.read()
108109

109-
with open(os.path.join(yatest_common.output_path(suffix)), 'r') as fd:
110+
with open(os.path.join(yatest.commmon.output_path(suffix)), 'r') as fd:
110111
return fd.read()
111112

112113

@@ -222,7 +223,7 @@ def generate_data_path(self):
222223
if self.arguments.ydb_working_dir:
223224
self.data_path = self.arguments.ydb_working_dir
224225
return self.data_path
225-
self.data_path = yatest_common.output_path(self.data_path_template % random_string())
226+
self.data_path = yatest.commmon.output_path(self.data_path_template % random_string())
226227
return ensure_path_exists(self.data_path)
227228

228229

ydb/tests/acceptance/test_slice.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import os
22
import sys
33

4+
import yatest
5+
46
import ydb
5-
from ydb.tests.library.common import yatest_common
67
from ydb.tests.library.harness.ydbd_slice import YdbdSlice
78

89

@@ -13,8 +14,8 @@ class TestWithSlice(object):
1314
@classmethod
1415
def setup_class(cls):
1516
cls.cluster = YdbdSlice(
16-
config_path=yatest_common.source_path(os.environ["YDB_CLUSTER_YAML"]),
17-
binary_path=yatest_common.binary_path(os.environ["YDB_DRIVER_BINARY"])
17+
config_path=yatest.common.source_path(os.environ["YDB_CLUSTER_YAML"]),
18+
binary_path=yatest.common.binary_path(os.environ["YDB_DRIVER_BINARY"])
1819
)
1920
cls.cluster.start()
2021

@@ -42,12 +43,12 @@ def test_slice_sample(self):
4243
)
4344

4445
def test_serializable(self):
45-
yatest_common.execute(
46+
yatest.common.execute(
4647
[
47-
yatest_common.binary_path('ydb/tests/tools/ydb_serializable/ydb_serializable'),
48+
yatest.common.binary_path('ydb/tests/tools/ydb_serializable/ydb_serializable'),
4849
'--endpoint=%s:%d' % (self.cluster.nodes[1].host, self.cluster.nodes[1].grpc_port),
4950
'--database=%s' % self.cluster.db_path,
50-
'--output-path=%s' % yatest_common.output_path(),
51+
'--output-path=%s' % yatest.common.output_path(),
5152
'--iterations=25',
5253
'--processes=1'
5354
],

ydb/tests/fq/mem_alloc/test_alloc_default.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
import six
88
import time
99

10+
import yatest
11+
1012
from ydb.tests.tools.datastreams_helpers.test_yds_base import TestYdsBase
11-
import ydb.tests.library.common.yatest_common as yatest_common
1213
from ydb.tests.tools.fq_runner.fq_client import FederatedQueryClient
1314
from ydb.tests.tools.fq_runner.kikimr_runner import StreamingOverKikimr
1415
from ydb.tests.tools.fq_runner.kikimr_runner import StreamingOverKikimrConfig
@@ -54,8 +55,8 @@ def kikimr(request):
5455

5556
def wait_until(
5657
predicate,
57-
wait_time=yatest_common.plain_or_under_sanitizer(10, 50),
58-
wait_step=yatest_common.plain_or_under_sanitizer(0.5, 2),
58+
wait_time=yatest.common.plain_or_under_sanitizer(10, 50),
59+
wait_step=yatest.common.plain_or_under_sanitizer(0.5, 2),
5960
):
6061
deadline = time.time() + wait_time
6162
while time.time() < deadline:

ydb/tests/fq/mem_alloc/test_scheduling.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import pytest
77
import time
88

9-
import ydb.tests.library.common.yatest_common as yatest_common
9+
import yatest
10+
1011
from ydb.tests.tools.fq_runner.fq_client import FederatedQueryClient
1112
from ydb.tests.tools.fq_runner.kikimr_runner import StreamingOverKikimr
1213
from ydb.tests.tools.fq_runner.kikimr_runner import StreamingOverKikimrConfig
@@ -18,8 +19,8 @@
1819
G = 1024 * 1024 * 1024
1920
DEFAULT_LIMIT = 8 * G
2021
DEFAULT_DELTA = 30 * M
21-
DEFAULT_WAIT_TIME = yatest_common.plain_or_under_sanitizer(10, 50)
22-
LONG_WAIT_TIME = yatest_common.plain_or_under_sanitizer(60, 300)
22+
DEFAULT_WAIT_TIME = yatest.common.plain_or_under_sanitizer(10, 50)
23+
LONG_WAIT_TIME = yatest.common.plain_or_under_sanitizer(60, 300)
2324

2425

2526
@pytest.fixture
@@ -37,7 +38,7 @@ def kikimr(request):
3738
kikimr.stop()
3839

3940

40-
def wait_until(predicate, wait_time=DEFAULT_WAIT_TIME, wait_step=yatest_common.plain_or_under_sanitizer(0.5, 2)):
41+
def wait_until(predicate, wait_time=DEFAULT_WAIT_TIME, wait_step=yatest.common.plain_or_under_sanitizer(0.5, 2)):
4142
deadline = time.time() + wait_time
4243
while time.time() < deadline:
4344
if predicate():

ydb/tests/fq/restarts/test_insert_restarts.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
import pytest
77
import time
88

9+
import yatest
10+
911
import ydb.public.api.protos.draft.fq_pb2 as fq
1012

11-
import ydb.tests.library.common.yatest_common as yatest_common
1213
from ydb.tests.tools.fq_runner.kikimr_utils import yq_all
1314

1415

@@ -71,7 +72,7 @@ def test_atomic_upload_commit(self, kikimr, s3, client):
7172
query_id = client.create_query("simple", sql, type=fq.QueryContent.QueryType.ANALYTICS).result.query_id
7273

7374
# Checking insert query
74-
timeout = yatest_common.plain_or_under_sanitizer(250, 250 * 5)
75+
timeout = yatest.common.plain_or_under_sanitizer(250, 250 * 5)
7576
start = time.time()
7677
deadline = start + timeout
7778
while True:

ydb/tests/fq/s3/s3_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from dataclasses import dataclass
55
import boto3
66

7-
import ydb.tests.library.common.yatest_common as yatest_common
7+
import yatest
88

99

1010
@dataclass
@@ -20,4 +20,4 @@ def create_bucket_and_upload_file(filename, s3_url, bucket_name, base_path):
2020
bucket.objects.all().delete()
2121

2222
s3_client = boto3.client("s3", endpoint_url=s3_url, aws_access_key_id="key", aws_secret_access_key="secret_key")
23-
s3_client.upload_file(yatest_common.source_path("{}/{}".format(base_path, filename)), bucket_name, filename)
23+
s3_client.upload_file(yatest.common.source_path("{}/{}".format(base_path, filename)), bucket_name, filename)

0 commit comments

Comments
 (0)