Skip to content

Commit 6df1995

Browse files
authored
Add test library: test meta (#14746)
1 parent 2872539 commit 6df1995

File tree

10 files changed

+30
-9
lines changed

10 files changed

+30
-9
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pytest
2+
3+
link_test_case = pytest.mark.test_case

ydb/tests/sql/lib/conftest.py renamed to ydb/tests/library/test_meta/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def pytest_runtest_makereport(item, call):
1515
outcome = yield
1616
report = outcome.get_result()
1717

18-
if call.when == "teardown":
18+
if call.when == "call":
1919
test_meta_dir = os.getenv("TEST_META_INFO")
2020

2121
if test_meta_dir:

ydb/tests/library/test_meta/ya.make

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
PY3_LIBRARY()
2+
3+
PY_SRCS(
4+
__init__.py
5+
conftest.py
6+
)
7+
8+
PEERDIR(
9+
contrib/python/pytest
10+
)
11+
12+
END()

ydb/tests/library/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ RECURSE(
109109
compatibility
110110
clients
111111
serializability
112+
test_meta
112113
wardens
113114
sqs
114115
)

ydb/tests/olap/ttl_tiering/data_correctness.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import random
77
import datetime
88

9+
from ydb.tests.library.test_meta import link_test_case
10+
911
logger = logging.getLogger(__name__)
1012

1113

@@ -72,8 +74,8 @@ def wait_eviction(self, table: ColumnTableHelper):
7274
stats = table.get_portion_stat_by_tier()
7375
assert len(stats) > 1 or '__DEFAULT' not in stats
7476

77+
@link_test_case("#13465")
7578
def test(self):
76-
"""Implements https://github.com/ydb-platform/ydb/issues/13465"""
7779
test_dir = f"{self.ydb_client.database}/{self.test_name}"
7880
table_path = f"{test_dir}/table"
7981
secret_prefix = self.test_name

ydb/tests/olap/ttl_tiering/data_migration_when_alter_ttl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from .base import TllTieringTestBase, ColumnTableHelper
44
from ydb.tests.library.common.helpers import plain_or_under_sanitizer
55

6+
from ydb.tests.library.test_meta import link_test_case
7+
68
logger = logging.getLogger(__name__)
79

810

@@ -24,9 +26,8 @@ def get_row_count_by_minute(self, table_path: str, past_minutes: int) -> int:
2426
f"SELECT count(*) as Rows from `{table_path}` WHERE timestamp < CurrentUtcTimestamp() - DateTime::IntervalFromMinutes({past_minutes})"
2527
)[0].rows[0]["Rows"]
2628

29+
@link_test_case("#13466")
2730
def test(self):
28-
'''Implements https://github.com/ydb-platform/ydb/issues/13466'''
29-
3031
test_dir = f"{self.ydb_client.database}/{self.test_name}"
3132
table_path = f"{test_dir}/table"
3233
secret_prefix = self.test_name

ydb/tests/olap/ttl_tiering/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ SIZE(MEDIUM)
1616

1717
PEERDIR(
1818
ydb/tests/library
19+
ydb/tests/library/test_meta
1920
ydb/public/sdk/python
2021
ydb/public/sdk/python/enable_v3_new_behavior
2122
contrib/python/boto3

ydb/tests/sql/large/test_bulkupserts_tpch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# -*- coding: utf-8 -*-
22
import random
33
import ydb
4-
import pytest
54

5+
from ydb.tests.library.test_meta import link_test_case
66
from ydb.tests.sql.lib.test_base import TpchTestBaseH1
77
from ydb.tests.sql.lib.helpers import split_data_into_fixed_size_chunks
88

99

1010
class TestTpchBulkUpsertsOperations(TpchTestBaseH1):
1111

12-
@pytest.mark.test_case("#14643")
12+
@link_test_case("#14643")
1313
def test_bulk_upsert_lineitem_with_overlapping_keys(self):
1414
"""
1515
Test bulk upsert into the lineitem table with overlapping keys.
@@ -74,7 +74,7 @@ def generate_lineitem_data(offset):
7474

7575
assert inserted_quantity == result_quantity, f"Mismatch in l_quantity for {key}"
7676

77-
@pytest.mark.test_case("#14642")
77+
@link_test_case("#14642")
7878
def test_repeated_bulk_upsert_lineitem(self):
7979
"""
8080
Test that repeatedly upserting records in the lineitem table with the same keys results,

ydb/tests/sql/large/test_workload_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import concurrent.futures
33
from ydb.tests.sql.lib.test_base import TpchTestBaseH1
44
from ydb.tests.library.common import workload_manager
5+
from ydb.tests.library.test_meta import link_test_case
56
import ydb
67
import time
78
import pytest
@@ -57,7 +58,7 @@ def test_crud(self):
5758
"""
5859
self.query(pool_definition)
5960

60-
@pytest.mark.test_case("#14602")
61+
@link_test_case("#14602")
6162
@pytest.mark.parametrize("wait_for_timeout", [(False), (True)])
6263
def test_pool_classifier_init(self, wait_for_timeout):
6364
"""

ydb/tests/sql/lib/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ PY_SRCS(
77
helpers.py
88
test_query.py
99
test_s3.py
10-
conftest.py
1110
)
1211

1312
PEERDIR(
1413
ydb/tests/library
14+
ydb/tests/library/test_meta
1515
library/python/testing/recipe
1616
library/recipes/common
1717
contrib/python/moto

0 commit comments

Comments
 (0)