Skip to content

Add test library: test meta #14746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ydb/tests/library/test_meta/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import pytest

link_test_case = pytest.mark.test_case
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()

if call.when == "teardown":
if call.when == "call":
test_meta_dir = os.getenv("TEST_META_INFO")

if test_meta_dir:
Expand Down
12 changes: 12 additions & 0 deletions ydb/tests/library/test_meta/ya.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PY3_LIBRARY()

PY_SRCS(
__init__.py
conftest.py
)

PEERDIR(
contrib/python/pytest
)

END()
1 change: 1 addition & 0 deletions ydb/tests/library/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ RECURSE(
compatibility
clients
serializability
test_meta
wardens
sqs
)
Expand Down
4 changes: 3 additions & 1 deletion ydb/tests/olap/ttl_tiering/data_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import random
import datetime

from ydb.tests.library.test_meta import link_test_case

logger = logging.getLogger(__name__)


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

@link_test_case("#13465")
def test(self):
"""Implements https://github.com/ydb-platform/ydb/issues/13465"""
test_dir = f"{self.ydb_client.database}/{self.test_name}"
table_path = f"{test_dir}/table"
secret_prefix = self.test_name
Expand Down
5 changes: 3 additions & 2 deletions ydb/tests/olap/ttl_tiering/data_migration_when_alter_ttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .base import TllTieringTestBase, ColumnTableHelper
from ydb.tests.library.common.helpers import plain_or_under_sanitizer

from ydb.tests.library.test_meta import link_test_case

logger = logging.getLogger(__name__)


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

@link_test_case("#13466")
def test(self):
'''Implements https://github.com/ydb-platform/ydb/issues/13466'''

test_dir = f"{self.ydb_client.database}/{self.test_name}"
table_path = f"{test_dir}/table"
secret_prefix = self.test_name
Expand Down
1 change: 1 addition & 0 deletions ydb/tests/olap/ttl_tiering/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SIZE(MEDIUM)

PEERDIR(
ydb/tests/library
ydb/tests/library/test_meta
ydb/public/sdk/python
ydb/public/sdk/python/enable_v3_new_behavior
contrib/python/boto3
Expand Down
6 changes: 3 additions & 3 deletions ydb/tests/sql/large/test_bulkupserts_tpch.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
import random
import ydb
import pytest

from ydb.tests.library.test_meta import link_test_case
from ydb.tests.sql.lib.test_base import TpchTestBaseH1
from ydb.tests.sql.lib.helpers import split_data_into_fixed_size_chunks


class TestTpchBulkUpsertsOperations(TpchTestBaseH1):

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

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

@pytest.mark.test_case("#14642")
@link_test_case("#14642")
def test_repeated_bulk_upsert_lineitem(self):
"""
Test that repeatedly upserting records in the lineitem table with the same keys results,
Expand Down
3 changes: 2 additions & 1 deletion ydb/tests/sql/large/test_workload_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import concurrent.futures
from ydb.tests.sql.lib.test_base import TpchTestBaseH1
from ydb.tests.library.common import workload_manager
from ydb.tests.library.test_meta import link_test_case
import ydb
import time
import pytest
Expand Down Expand Up @@ -57,7 +58,7 @@ def test_crud(self):
"""
self.query(pool_definition)

@pytest.mark.test_case("#14602")
@link_test_case("#14602")
@pytest.mark.parametrize("wait_for_timeout", [(False), (True)])
def test_pool_classifier_init(self, wait_for_timeout):
"""
Expand Down
2 changes: 1 addition & 1 deletion ydb/tests/sql/lib/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ PY_SRCS(
helpers.py
test_query.py
test_s3.py
conftest.py
)

PEERDIR(
ydb/tests/library
ydb/tests/library/test_meta
library/python/testing/recipe
library/recipes/common
contrib/python/moto
Expand Down