@@ -41,40 +41,55 @@ def get_gateways_config(http_files, yql_http_file_server, force_blocks=False, is
41
41
return config
42
42
43
43
44
- def run_file_no_cache (provider , suite , case , cfg , config , yql_http_file_server , yqlrun_binary = None , extra_args = [], force_blocks = False ):
44
+ def is_hybrid (provider ):
45
+ return provider == 'hybrid'
46
+
47
+
48
+ def check_provider (provider , config ):
45
49
if provider not in get_supported_providers (config ):
46
50
pytest .skip ('%s provider is not supported here' % provider )
47
51
52
+
53
+ def get_sql_query (provider , suite , case , config ):
48
54
pragmas = get_pragmas (config )
49
55
50
56
if get_param ('TARGET_PLATFORM' ):
51
57
if "yson" in case or "regexp" in case or "match" in case :
52
58
pytest .skip ('yson/match/regexp is not supported on non-default target platform' )
53
59
54
- xfail = is_xfail (config )
55
- if get_param ('TARGET_PLATFORM' ) and xfail :
60
+ if get_param ('TARGET_PLATFORM' ) and is_xfail (config ):
56
61
pytest .skip ('xfail is not supported on non-default target platform' )
57
62
58
- in_tables , out_tables = get_tables (suite , config , DATA_PATH , def_attr = KSV_ATTR )
59
- files = get_files (suite , config , DATA_PATH )
60
- http_files = get_http_files (suite , config , DATA_PATH )
61
- http_files_urls = yql_http_file_server .register_files ({}, http_files )
62
-
63
63
program_sql = os .path .join (DATA_PATH , suite , '%s.sql' % case )
64
- is_hybrid = provider == 'hybrid'
65
64
66
65
with codecs .open (program_sql , encoding = 'utf-8' ) as program_file_descr :
67
66
sql_query = program_file_descr .read ()
68
67
if get_param ('TARGET_PLATFORM' ):
69
68
if "Yson::" in sql_query :
70
69
pytest .skip ('yson udf is not supported on non-default target platform' )
71
- if (provider + 'file can not' in sql_query ) or (is_hybrid and ('ytfile can not' in sql_query )):
70
+ if (provider + 'file can not' in sql_query ) or (is_hybrid ( provider ) and ('ytfile can not' in sql_query )):
72
71
pytest .skip (provider + ' can not execute this' )
73
72
74
73
pragmas .append (sql_query )
75
74
sql_query = ';\n ' .join (pragmas )
76
75
if 'Python' in sql_query or 'Javascript' in sql_query :
77
76
pytest .skip ('ScriptUdf' )
77
+
78
+ return sql_query
79
+
80
+
81
+ def run_file_no_cache (provider , suite , case , cfg , config , yql_http_file_server , yqlrun_binary = None , extra_args = [], force_blocks = False ):
82
+ check_provider (provider , config )
83
+
84
+ sql_query = get_sql_query (provider , suite , case , config )
85
+
86
+ xfail = is_xfail (config )
87
+
88
+ in_tables , out_tables = get_tables (suite , config , DATA_PATH , def_attr = KSV_ATTR )
89
+ files = get_files (suite , config , DATA_PATH )
90
+ http_files = get_http_files (suite , config , DATA_PATH )
91
+ http_files_urls = yql_http_file_server .register_files ({}, http_files )
92
+
78
93
for table in in_tables :
79
94
if cyson .loads (table .attr ).get ("type" ) == "document" :
80
95
content = table .content
@@ -89,7 +104,7 @@ def run_file_no_cache(provider, suite, case, cfg, config, yql_http_file_server,
89
104
prov = provider ,
90
105
keep_temp = not re .search (r"yt\.ReleaseTempData" , sql_query ),
91
106
binary = yqlrun_binary ,
92
- gateway_config = get_gateways_config (http_files , yql_http_file_server , force_blocks = force_blocks , is_hybrid = is_hybrid ),
107
+ gateway_config = get_gateways_config (http_files , yql_http_file_server , force_blocks = force_blocks , is_hybrid = is_hybrid ( provider ) ),
93
108
extra_args = extra_args ,
94
109
udfs_dir = yql_binary_path ('ydb/library/yql/tests/common/test_framework/udfs_deps' )
95
110
)
0 commit comments