Skip to content

Commit

Permalink
Fix style tests and add workaround to fix PR check for them (ydb-plat…
Browse files Browse the repository at this point in the history
  • Loading branch information
maximyurchuk authored Aug 16, 2024
1 parent ac738f9 commit 37cf6b0
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 35 deletions.
1 change: 1 addition & 0 deletions .github/actions/test_ya/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ runs:

if [ true = ${{ inputs.run_tests }} ]; then
params+=(-A)
params+=(--retest)
fi

params+=(
Expand Down
2 changes: 2 additions & 0 deletions ydb/library/yql/tests/common/test_framework/yql_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,14 @@ def is_canonize_yt(cfg):
return True
return False


def is_with_final_result_issues(cfg):
for item in cfg:
if item[0] == 'with_final_result_issues':
return True
return False


def skip_test_if_required(cfg):
for item in cfg:
if item[0] == 'skip_test':
Expand Down
6 changes: 3 additions & 3 deletions ydb/tests/fq/s3/test_compressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def validate_result(self, result_set):
assert result_set.rows[0].items[0].bytes_value == b"yq"
assert result_set.rows[0].items[1].int32_value == 0
assert result_set.rows[0].items[2].bytes_value == b"abc"

def validate_result_csv(self, result_set):
logging.debug(str(result_set))
assert len(result_set.columns) == 3
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_compression_inference(self, kikimr, s3, client, filename, compression,
self.create_bucket_and_upload_file(filename, s3, kikimr)
storage_connection_name = unique_prefix + "fruitbucket"
client.create_storage_connection(storage_connection_name, "fbucket")

sql = '''
SELECT *
FROM `{}`.`{}`
Expand Down Expand Up @@ -204,7 +204,7 @@ def test_invalid_compression(self, kikimr, s3, client, unique_prefix):
assert (
"Unknown compression: some_compression. Use one of: gzip, zstd, lz4, brotli, bzip2, xz" in describe_string
)

@yq_v2
@pytest.mark.parametrize("client", [{"folder_id": "my_folder"}], indirect=True)
def test_invalid_compression_inference(self, kikimr, s3, client, unique_prefix):
Expand Down
2 changes: 1 addition & 1 deletion ydb/tests/fq/s3/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def validate_result(self, result_set):
assert result_set.rows[2].items[0].bytes_value == b"Pear"
assert result_set.rows[2].items[1].int32_value == 15
assert result_set.rows[2].items[2].int32_value == 33

def validate_result_inference(self, result_set):
logging.debug(str(result_set))
assert len(result_set.columns) == 3
Expand Down
2 changes: 1 addition & 1 deletion ydb/tests/fq/s3/test_s3_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_inference_null_column(self, kikimr, s3, client, unique_prefix):
assert result_set.rows[2].items[1].text_value == ""
assert result_set.rows[2].items[2].int64_value == 15
assert sum(kikimr.control_plane.get_metering(1)) == 10

@yq_v2
@pytest.mark.parametrize("client", [{"folder_id": "my_folder"}], indirect=True)
def test_inference_optional_types(self, kikimr, s3, client, unique_prefix):
Expand Down
4 changes: 2 additions & 2 deletions ydb/tests/functional/tenants/test_tenants.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ def _get_entry_schema(entry):
permissions=[x.to_pb() for x in entry.permissions],
)

if type(item) == ydb.scheme.Directory:
if isinstance(item, ydb.scheme.Directory):
d = dict(scheme_type='Directory')
d.update(_get_entry_schema(item))
d.update(dict(
children=[convert(x) for x in item.children]
))
elif type(item) == ydb.scheme.SchemeEntry:
elif isinstance(item, ydb.scheme.SchemeEntry):
d = dict(scheme_type='SchemeEntry')
d.update(_get_entry_schema(item))
else:
Expand Down
4 changes: 2 additions & 2 deletions ydb/tests/library/harness/kikimr_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ def __init__(
self.yaml_config["feature_flags"]['enable_temp_tables'] = True
self.yaml_config["feature_flags"]['enable_table_pg_types'] = True
self.yaml_config['feature_flags']['enable_uniq_constraint'] = True
if not "local_pg_wire_config" in self.yaml_config:
if "local_pg_wire_config" not in self.yaml_config:
self.yaml_config["local_pg_wire_config"] = {}

ydb_pgwire_port=self.port_allocator.get_node_port_allocator(node_id).pgwire_port
ydb_pgwire_port = self.port_allocator.get_node_port_allocator(node_id).pgwire_port
self.yaml_config['local_pg_wire_config']['listening_port'] = ydb_pgwire_port

# https://github.com/ydb-platform/ydb/issues/5152
Expand Down
51 changes: 26 additions & 25 deletions ydb/tests/tools/mdb_mock/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import yatest.common as yat
from library.python.testing.recipe import declare_recipe, set_env
from library.recipes.common import find_free_ports, start_daemon
from library.recipes.common import find_free_ports

logger = logging.getLogger('mdb_mock.recipe')

Expand All @@ -18,17 +18,15 @@ async def clickhouse_handler(request):
cluster_id = request.match_info['cluster_id']

if cluster_id == 'clickhouse_cluster_id':
return web.Response(body=json.dumps(
{
'hosts': [
{
'name': 'clickhouse',
'cluster_id': cluster_id,
'health': 'ALIVE',
'type': 'CLICKHOUSE'
},
]
}))
return web.Response(
body=json.dumps(
{
'hosts': [
{'name': 'clickhouse', 'cluster_id': cluster_id, 'health': 'ALIVE', 'type': 'CLICKHOUSE'},
]
}
)
)

return web.Response(body=json.dumps({}))

Expand All @@ -37,19 +35,22 @@ async def postgresql_handler(request):
cluster_id = request.match_info['cluster_id']

if cluster_id == 'postgresql_cluster_id':
return web.Response(body=json.dumps(
{
'hosts': [
{
'name': 'postgresql',
'services': [
{
'health': 'ALIVE',
},
],
}
]
}))
return web.Response(
body=json.dumps(
{
'hosts': [
{
'name': 'postgresql',
'services': [
{
'health': 'ALIVE',
},
],
}
]
}
)
)
return web.Response(body=json.dumps({}))


Expand Down
2 changes: 1 addition & 1 deletion ydb/tools/cfg/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def mbus_enabled(self):
@property
def table_service_config(self):
return self.__cluster_details.get_service("table_service_config")

@property
def column_shard_config(self):
return self.__cluster_details.get_service("column_shard_config")
Expand Down

0 comments on commit 37cf6b0

Please sign in to comment.