Add ability to add comments in skip-list.json

This commit is contained in:
alesapin 2020-08-27 11:17:01 +03:00
parent 67f16d5ae8
commit d40e203ecd
2 changed files with 77 additions and 7 deletions

View File

@ -36,6 +36,63 @@ MESSAGES_TO_RETRY = [
]
def json_minify(string):
"""
Removes all js-style comments from json string. Allows to have comments in skip_list.json.
The code taken from https://github.com/getify/JSON.minify/tree/python
"""
tokenizer = re.compile('"|(/\*)|(\*/)|(//)|\n|\r')
end_slashes_re = re.compile(r'(\\)*$')
in_string = False
in_multi = False
in_single = False
new_str = []
index = 0
for match in re.finditer(tokenizer, string):
if not (in_multi or in_single):
tmp = string[index:match.start()]
new_str.append(tmp)
else:
# Replace comments with white space so that the JSON parser reports
# the correct column numbers on parsing errors.
new_str.append(' ' * (match.start() - index))
index = match.end()
val = match.group()
if val == '"' and not (in_multi or in_single):
escaped = end_slashes_re.search(string, 0, match.start())
# start of string or unescaped quote character to end string
if not in_string or (escaped is None or len(escaped.group()) % 2 == 0): # noqa
in_string = not in_string
index -= 1 # include " character in next catch
elif not (in_string or in_multi or in_single):
if val == '/*':
in_multi = True
elif val == '//':
in_single = True
elif val == '*/' and in_multi and not (in_string or in_single):
in_multi = False
new_str.append(' ' * len(val))
elif val in '\r\n' and not (in_multi or in_string) and in_single:
in_single = False
elif not in_multi or in_single: # noqa
new_str.append(val)
if val in '\r\n':
new_str.append(val)
elif in_multi or in_single:
new_str.append(' ' * len(val))
new_str.append(string[index:])
return ''.join(new_str)
def remove_control_characters(s):
"""
https://github.com/html5lib/html5lib-python/issues/96#issuecomment-43438438
@ -707,7 +764,9 @@ def collect_tests_to_skip(skip_list_path, build_flags):
return result
with open(skip_list_path, 'r') as skip_list_file:
skip_dict = json.load(skip_list_file)
content = skip_list_file.read()
# allows to have comments in skip_list.json
skip_dict = json.loads(json_minify(content))
for build_flag in build_flags:
result |= set(skip_dict[build_flag])

View File

@ -1,3 +1,6 @@
/** List of tests which should be skipped depending on clickhouse build options.
* This file in json format, but javascript-style comments are allowed.
*/
{
"thread-sanitizer": [
"00281",
@ -6,11 +9,12 @@
"avx2",
"query_profiler",
"memory_profiler",
/// 01083 and 00505 and 00505 are critical and temproray disabled
"01083_expressions_in_engine_arguments",
"00505_shard_secure",
"00505_secure",
"01103_check_cpu_instructions_at_startup",
"01098_temporary_and_external_tables",
"01098_temporary_and_external_tables", /// race in openssl (should be enabled as fast as possible)
"00152_insert_different_granularity",
"00151_replace_partition_with_different_granularity",
"00157_cache_dictionary",
@ -43,9 +47,9 @@
"query_profiler",
"memory_profiler",
"01103_check_cpu_instructions_at_startup",
"01086_odbc_roundtrip",
"00877_memory_limit_for_new_delete",
"01114_mysql_database_engine_segfault",
"01086_odbc_roundtrip", /// can't pass because odbc libraries are not instrumented
"00877_memory_limit_for_new_delete", /// memory limits don't work correctly under msan because it replaces malloc/free
"01114_mysql_database_engine_segfault", /// it fails in _nss_files_parse_servent while using NSS from GLibc to authenticate (need to get rid of it)
"01193_metadata_loading"
],
"debug-build": [
@ -99,21 +103,25 @@
"database-atomic": [
"00065_loyalty_with_storage_join",
"avx",
/// Inner tables of materialized views have different names
"00738_lock_for_inner_table",
"00699_materialized_view_mutations",
"00609_mv_index_in_in",
"00510_materizlized_view_and_deduplication_zookeeper",
/// Create queries contain UUID
"00604_show_create_database",
"00080_show_tables_and_system_tables",
"01272_suspicious_codecs",
/// UUID must be specified in ATTACH TABLE
"01249_bad_arguments_for_bloom_filter",
"00423_storage_log_single_thread",
"00311_array_primary_key",
"00226_zookeeper_deduplication_and_unexpected_parts",
"00180_attach_materialized_view",
"00116_storage_set",
/// Assumes blocking DROP
"00816_long_concurrent_alter_column",
"00992_system_parts_race_condition_zookeeper",
"00992_system_parts_race_condition_zookeeper", /// FIXME
"01320_create_sync_race_condition",
"01305_replica_create_drop_zookeeper",
"01130_in_memory_parts_partitons",
@ -121,6 +129,9 @@
"01224_no_superfluous_dict_reload"
],
"polymorphic-parts": [
/// These tests fail with compact parts, because they
/// check some implementation defined things
/// like checksums, computed granularity, ProfileEvents, etc.
"avx",
"01045_order_by_pk_special_storages",
"01042_check_query_and_last_granule_size",
@ -139,7 +150,7 @@
"00160_merge_and_index_in_in",
"01055_compact_parts",
"01039_mergetree_exec_time",
"00933_ttl_simple",
"00933_ttl_simple", /// Maybe it's worth to fix it
"00753_system_columns_and_system_tables",
"01343_min_bytes_to_use_mmap_io",
"01344_min_bytes_to_use_mmap_io_index"