Skip to content

Commit 8b9f13e

Browse files
committed
Check custom error in xfail tests. Remove canonization from dq/hybrid tests
1. xfail тесты теперь должны содержать спец комментарий `custom error` с ожидаемым текстом ошибки 2. Все suites для xfail размечены спец. коментариями, некоторые тесты разбиты на несколько 3. Включены тесты с Python и Javascript udf для yt провайдера и переканонизированы (были отключены в github) 4. Для тяжелых xfail тестов аналогично убрана канонизация и включена проверка по спец. коментарию 5. Из dq_file/hybrid тестов убрана канонизация. Осталась только кросс-проверка результатов с yqlrun и блочным режимом 6. В dqrun теперь используется exception_policy вместо fail_policy (для корректной выдачи ошибок в тестах) commit_hash:a92b3835f86b0c01225e81e3f28bb6d11d8d67a3
1 parent 284518c commit 8b9f13e

File tree

151 files changed

+617
-646
lines changed

Some content is hidden

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

151 files changed

+617
-646
lines changed

build/platform/python/ldflags/ya.make

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
RESOURCES_LIBRARY()
22

3-
SUBSCRIBER(g:contrib)
4-
53
IF (USE_SYSTEM_PYTHON)
64
IF (OS_LINUX)
75
LDFLAGS("-L$EXTERNAL_PYTHON_RESOURCE_GLOBAL/python/lib/x86_64-linux-gnu -lpython${PY_VERSION}")

library/python/type_info/ya.make

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
PY23_LIBRARY()
22

3-
SUBSCRIBER(
4-
g:yt
5-
)
6-
73
PEERDIR(
84
yt/python/yt/type_info
95
)

yql/essentials/tests/common/test_framework/test_file_common.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from google.protobuf import text_format
1010
from yql_utils import execute_sql, get_supported_providers, get_tables, get_files, get_http_files, \
11-
get_pragmas, KSV_ATTR, is_xfail, get_param, YQLExecResult, yql_binary_path
11+
get_pragmas, KSV_ATTR, is_xfail, get_param, YQLExecResult, yql_binary_path, do_custom_error_check
1212
from yqlrun import YQLRun
1313

1414
from test_utils import get_parameters_json, DATA_PATH, replace_vars
@@ -70,7 +70,7 @@ def get_sql_query(provider, suite, case, config):
7070

7171
pragmas.append(sql_query)
7272
sql_query = ';\n'.join(pragmas)
73-
if 'Python' in sql_query or 'Javascript' in sql_query:
73+
if provider != 'yt' and 'Javascript' in sql_query:
7474
pytest.skip('ScriptUdf')
7575

7676
assert 'UseBlocks' not in sql_query, 'UseBlocks should not be used directly, only via ForceBlocks'
@@ -96,7 +96,7 @@ def run_file_no_cache(provider, suite, case, cfg, config, yql_http_file_server,
9696
content = table.content
9797
else:
9898
content = table.attr
99-
if 'Python' in content or 'Javascript' in content:
99+
if provider != 'yt' and 'Javascript' in content:
100100
pytest.skip('ScriptUdf')
101101

102102
parameters = get_parameters_json(suite, config)
@@ -124,11 +124,8 @@ def run_file_no_cache(provider, suite, case, cfg, config, yql_http_file_server,
124124
fixed_stderr = res.std_err
125125
if xfail:
126126
assert res.execution_result.exit_code != 0
127-
custom_error = re.search(r"/\* custom error:(.*)\*/", sql_query)
128-
if custom_error:
129-
err_string = custom_error.group(1)
130-
assert res.std_err.find(err_string) != -1
131-
fixed_stderr = None
127+
do_custom_error_check(res, sql_query)
128+
fixed_stderr = None
132129

133130
fixed_result = YQLExecResult(res.std_out,
134131
fixed_stderr,

yql/essentials/tests/common/test_framework/udfs_deps/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SET(
66
yql/essentials/udfs/common/hyperloglog
77
yql/essentials/udfs/common/pire
88
yql/essentials/udfs/common/protobuf
9+
yql/essentials/udfs/common/python/python3_small
910
yql/essentials/udfs/common/re2
1011
yql/essentials/udfs/common/set
1112
yql/essentials/udfs/common/stat

yql/essentials/tests/common/test_framework/yql_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ def do_custom_query_check(res, sql_query):
5050
return True
5151

5252

53+
def do_custom_error_check(res, sql_query):
54+
err_string = None
55+
custom_error = re.search(r"/\* custom error:(.*)\*/", sql_query)
56+
if custom_error:
57+
err_string = custom_error.group(1).strip()
58+
assert err_string, 'Expected custom error check in test.\nTest error: %s' % res.std_err
59+
log('Custom error: ' + err_string)
60+
assert err_string in res.std_err
61+
62+
5363
def get_gateway_cfg_suffix():
5464
default_suffix = None
5565
return get_param('gateway_config_suffix', default_suffix) or ''

yql/essentials/tests/sql/sql2yql/canondata/result.json

Lines changed: 413 additions & 441 deletions
Large diffs are not rendered by default.

yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_expr.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* yt can not */
2+
/* custom error: Expected data or optional of data, but got: List<String> */
23
use plato;
34

45
$n = ["foo"];

yql/essentials/tests/sql/suites/action/eval_atom_wrong_type_param.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* yt can not */
2+
/* custom error: Expected data or optional of data, but got optional of: List<String> */
23
use plato;
34

45
declare $n as List<String>?;

yql/essentials/tests/sql/suites/action/eval_on_modif_table_fail.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* syntax version 1 */
22
/* postgres can not */
3+
/* custom error: Table "Output" is used before commit */
34
USE plato;
45

56
insert into Output

yql/essentials/tests/sql/suites/action/eval_typeof_output_table.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* syntax version 1 */
22
/* postgres can not */
3+
/* custom error: Table "Output" does not exist */
34
USE plato;
45

56
INSERT INTO Output

0 commit comments

Comments
 (0)