|
@@ -30,14 +30,14 @@ VALID_DNS_REQUIREMENTS = ("default", "local", "dns64")
|
|
|
BLOCK_SEPARATOR = '============================================================='
|
|
|
SPLIT_FACTOR_MAX_VALUE = 1000
|
|
|
SPLIT_FACTOR_TEST_FILES_MAX_VALUE = 4250
|
|
|
-PARTITION_MODS = ('SEQUENTIAL', 'MODULO')
|
|
|
-DEFAULT_TIDY_CONFIG = "build/config/tests/clang_tidy/config.yaml"
|
|
|
-DEFAULT_TIDY_CONFIG_MAP_PATH = "build/yandex_specific/config/clang_tidy/tidy_default_map.json"
|
|
|
-PROJECT_TIDY_CONFIG_MAP_PATH = "build/yandex_specific/config/clang_tidy/tidy_project_map.json"
|
|
|
-
|
|
|
-
|
|
|
-tidy_config_map = None
|
|
|
-
|
|
|
+PARTITION_MODS = ('SEQUENTIAL', 'MODULO')
|
|
|
+DEFAULT_TIDY_CONFIG = "build/config/tests/clang_tidy/config.yaml"
|
|
|
+DEFAULT_TIDY_CONFIG_MAP_PATH = "build/yandex_specific/config/clang_tidy/tidy_default_map.json"
|
|
|
+PROJECT_TIDY_CONFIG_MAP_PATH = "build/yandex_specific/config/clang_tidy/tidy_project_map.json"
|
|
|
+
|
|
|
+
|
|
|
+tidy_config_map = None
|
|
|
+
|
|
|
def ontest_data(unit, *args):
|
|
|
ymake.report_configure_error("TEST_DATA is removed in favour of DATA")
|
|
|
|
|
@@ -61,14 +61,14 @@ def prepare_env(data):
|
|
|
return serialize_list(shlex.split(data))
|
|
|
|
|
|
|
|
|
-def is_yt_spec_contain_pool_info(filename): # XXX switch to yson in ymake + perf test for configure
|
|
|
- pool_re = re.compile(r"""['"]*pool['"]*\s*?=""")
|
|
|
- cypress_root_re = re.compile(r"""['"]*cypress_root['"]*\s*=""")
|
|
|
- with open(filename, 'r') as afile:
|
|
|
- yt_spec = afile.read()
|
|
|
- return pool_re.search(yt_spec) and cypress_root_re.search(yt_spec)
|
|
|
-
|
|
|
-
|
|
|
+def is_yt_spec_contain_pool_info(filename): # XXX switch to yson in ymake + perf test for configure
|
|
|
+ pool_re = re.compile(r"""['"]*pool['"]*\s*?=""")
|
|
|
+ cypress_root_re = re.compile(r"""['"]*cypress_root['"]*\s*=""")
|
|
|
+ with open(filename, 'r') as afile:
|
|
|
+ yt_spec = afile.read()
|
|
|
+ return pool_re.search(yt_spec) and cypress_root_re.search(yt_spec)
|
|
|
+
|
|
|
+
|
|
|
def validate_sb_vault(name, value):
|
|
|
if not CANON_SB_VAULT_REGEX.match(value):
|
|
|
return "sb_vault value '{}' should follow pattern <ENV_NAME>=:<value|file>:<owner>:<vault key>".format(value)
|
|
@@ -84,8 +84,8 @@ def validate_choice_requirement(name, val, valid):
|
|
|
return "Unknown [[imp]]{}[[rst]] requirement: [[imp]]{}[[rst]], choose from [[imp]]{}[[rst]]".format(name, val, ", ".join(valid))
|
|
|
|
|
|
|
|
|
-def validate_force_sandbox_requirement(name, value, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, check_func):
|
|
|
- if is_force_sandbox or not in_autocheck or is_fuzzing or is_ytexec_run:
|
|
|
+def validate_force_sandbox_requirement(name, value, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, check_func):
|
|
|
+ if is_force_sandbox or not in_autocheck or is_fuzzing or is_ytexec_run:
|
|
|
if value == 'all':
|
|
|
return
|
|
|
return validate_numerical_requirement(name, value)
|
|
@@ -96,16 +96,16 @@ def validate_force_sandbox_requirement(name, value, test_size, is_force_sandbox,
|
|
|
|
|
|
|
|
|
# TODO: Remove is_kvm param when there will be guarantees on RAM
|
|
|
-def validate_requirement(req_name, value, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run):
|
|
|
+def validate_requirement(req_name, value, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run):
|
|
|
req_checks = {
|
|
|
'container': validate_numerical_requirement,
|
|
|
- 'cpu': lambda n, v: validate_force_sandbox_requirement(n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, reqs.check_cpu),
|
|
|
+ 'cpu': lambda n, v: validate_force_sandbox_requirement(n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, reqs.check_cpu),
|
|
|
'disk_usage': validate_numerical_requirement,
|
|
|
'dns': lambda n, v: validate_choice_requirement(n, v, VALID_DNS_REQUIREMENTS),
|
|
|
'kvm': None,
|
|
|
'network': lambda n, v: validate_choice_requirement(n, v, VALID_NETWORK_REQUIREMENTS),
|
|
|
- 'ram': lambda n, v: validate_force_sandbox_requirement(n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, reqs.check_ram),
|
|
|
- 'ram_disk': lambda n, v: validate_force_sandbox_requirement(n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, reqs.check_ram_disk),
|
|
|
+ 'ram': lambda n, v: validate_force_sandbox_requirement(n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, reqs.check_ram),
|
|
|
+ 'ram_disk': lambda n, v: validate_force_sandbox_requirement(n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, reqs.check_ram_disk),
|
|
|
'sb': None,
|
|
|
'sb_vault': validate_sb_vault,
|
|
|
}
|
|
@@ -147,7 +147,7 @@ def validate_test(unit, kw):
|
|
|
in_autocheck = "ya:not_autocheck" not in tags and 'ya:manual' not in tags
|
|
|
is_fat = 'ya:fat' in tags
|
|
|
is_force_sandbox = 'ya:force_distbuild' not in tags and is_fat
|
|
|
- is_ytexec_run = 'ya:yt' in tags
|
|
|
+ is_ytexec_run = 'ya:yt' in tags
|
|
|
is_fuzzing = valid_kw.get("FUZZING", False)
|
|
|
is_kvm = 'kvm' in requirements_orig
|
|
|
requirements = {}
|
|
@@ -176,7 +176,7 @@ def validate_test(unit, kw):
|
|
|
|
|
|
if not errors:
|
|
|
for req_name, req_value in requirements.items():
|
|
|
- error_msg = validate_requirement(req_name, req_value, size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run)
|
|
|
+ error_msg = validate_requirement(req_name, req_value, size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run)
|
|
|
if error_msg:
|
|
|
errors += [error_msg]
|
|
|
|
|
@@ -252,7 +252,7 @@ def validate_test(unit, kw):
|
|
|
break
|
|
|
|
|
|
if valid_kw.get("YT-SPEC"):
|
|
|
- if not is_ytexec_run:
|
|
|
+ if not is_ytexec_run:
|
|
|
errors.append("You can use YT_SPEC macro only tests marked with ya:yt tag")
|
|
|
else:
|
|
|
for filename in get_list("YT-SPEC"):
|
|
@@ -260,17 +260,17 @@ def validate_test(unit, kw):
|
|
|
if not os.path.exists(filename):
|
|
|
errors.append("File '{}' specified in the YT_SPEC macro doesn't exist".format(filename))
|
|
|
continue
|
|
|
- if is_yt_spec_contain_pool_info(filename) and "ya:external" not in tags:
|
|
|
- tags.append("ya:external")
|
|
|
- tags.append("ya:yt_research_pool")
|
|
|
+ if is_yt_spec_contain_pool_info(filename) and "ya:external" not in tags:
|
|
|
+ tags.append("ya:external")
|
|
|
+ tags.append("ya:yt_research_pool")
|
|
|
|
|
|
if valid_kw.get("USE_ARCADIA_PYTHON") == "yes" and valid_kw.get("SCRIPT-REL-PATH") == "py.test":
|
|
|
errors.append("PYTEST_SCRIPT is deprecated")
|
|
|
|
|
|
- partition = valid_kw.get('TEST_PARTITION', 'SEQUENTIAL')
|
|
|
- if partition not in PARTITION_MODS:
|
|
|
- raise ValueError('partition mode should be one of {}, detected: {}'.format(PARTITION_MODS, partition))
|
|
|
-
|
|
|
+ partition = valid_kw.get('TEST_PARTITION', 'SEQUENTIAL')
|
|
|
+ if partition not in PARTITION_MODS:
|
|
|
+ raise ValueError('partition mode should be one of {}, detected: {}'.format(PARTITION_MODS, partition))
|
|
|
+
|
|
|
if valid_kw.get('SPLIT-FACTOR'):
|
|
|
if valid_kw.get('FORK-MODE') == 'none':
|
|
|
errors.append('SPLIT_FACTOR must be use with FORK_TESTS() or FORK_SUBTESTS() macro')
|
|
@@ -292,7 +292,7 @@ def validate_test(unit, kw):
|
|
|
nfiles * value, SPLIT_FACTOR_TEST_FILES_MAX_VALUE, value))
|
|
|
|
|
|
unit_path = get_norm_unit_path(unit)
|
|
|
- if not is_fat and "ya:noretries" in tags and not is_ytexec_run \
|
|
|
+ if not is_fat and "ya:noretries" in tags and not is_ytexec_run \
|
|
|
and not unit_path.startswith("devtools/") \
|
|
|
and not unit_path.startswith("infra/kernel/") \
|
|
|
and not unit_path.startswith("yt/python/yt") \
|
|
@@ -382,37 +382,37 @@ def match_coverage_extractor_requirements(unit):
|
|
|
])
|
|
|
|
|
|
|
|
|
-def get_tidy_config_map(unit):
|
|
|
- global tidy_config_map
|
|
|
- if tidy_config_map is None:
|
|
|
- config_map_path = unit.resolve(os.path.join("$S", PROJECT_TIDY_CONFIG_MAP_PATH))
|
|
|
- with open(config_map_path, 'r') as afile:
|
|
|
- tidy_config_map = json.load(afile)
|
|
|
- return tidy_config_map
|
|
|
-
|
|
|
-
|
|
|
-def get_default_tidy_config(unit):
|
|
|
- unit_path = get_norm_unit_path(unit)
|
|
|
- default_config_map_path = unit.resolve(os.path.join("$S", DEFAULT_TIDY_CONFIG_MAP_PATH))
|
|
|
- with open(default_config_map_path, 'r') as afile:
|
|
|
- tidy_default_config_map = json.load(afile)
|
|
|
- for project_prefix, config_path in tidy_default_config_map.items():
|
|
|
- if unit_path.startswith(project_prefix):
|
|
|
- return config_path
|
|
|
- return DEFAULT_TIDY_CONFIG
|
|
|
-
|
|
|
-
|
|
|
-def get_project_tidy_config(unit):
|
|
|
- tidy_map = get_tidy_config_map(unit)
|
|
|
- unit_path = get_norm_unit_path(unit)
|
|
|
-
|
|
|
- for project_prefix, config_path in tidy_map.items():
|
|
|
- if unit_path.startswith(project_prefix):
|
|
|
- return config_path
|
|
|
- else:
|
|
|
- return get_default_tidy_config(unit)
|
|
|
-
|
|
|
-
|
|
|
+def get_tidy_config_map(unit):
|
|
|
+ global tidy_config_map
|
|
|
+ if tidy_config_map is None:
|
|
|
+ config_map_path = unit.resolve(os.path.join("$S", PROJECT_TIDY_CONFIG_MAP_PATH))
|
|
|
+ with open(config_map_path, 'r') as afile:
|
|
|
+ tidy_config_map = json.load(afile)
|
|
|
+ return tidy_config_map
|
|
|
+
|
|
|
+
|
|
|
+def get_default_tidy_config(unit):
|
|
|
+ unit_path = get_norm_unit_path(unit)
|
|
|
+ default_config_map_path = unit.resolve(os.path.join("$S", DEFAULT_TIDY_CONFIG_MAP_PATH))
|
|
|
+ with open(default_config_map_path, 'r') as afile:
|
|
|
+ tidy_default_config_map = json.load(afile)
|
|
|
+ for project_prefix, config_path in tidy_default_config_map.items():
|
|
|
+ if unit_path.startswith(project_prefix):
|
|
|
+ return config_path
|
|
|
+ return DEFAULT_TIDY_CONFIG
|
|
|
+
|
|
|
+
|
|
|
+def get_project_tidy_config(unit):
|
|
|
+ tidy_map = get_tidy_config_map(unit)
|
|
|
+ unit_path = get_norm_unit_path(unit)
|
|
|
+
|
|
|
+ for project_prefix, config_path in tidy_map.items():
|
|
|
+ if unit_path.startswith(project_prefix):
|
|
|
+ return config_path
|
|
|
+ else:
|
|
|
+ return get_default_tidy_config(unit)
|
|
|
+
|
|
|
+
|
|
|
def onadd_ytest(unit, *args):
|
|
|
keywords = {"DEPENDS": -1, "DATA": -1, "TIMEOUT": 1, "FORK_MODE": 1, "SPLIT_FACTOR": 1,
|
|
|
"FORK_SUBTESTS": 0, "FORK_TESTS": 0}
|
|
@@ -430,39 +430,39 @@ def onadd_ytest(unit, *args):
|
|
|
# Current ymake implementation doesn't allow to call macro inside the 'when' body
|
|
|
# that's why we add ADD_YTEST(coverage.extractor) to every PROGRAM entry and check requirements later
|
|
|
return
|
|
|
- elif flat_args[1] == "clang_tidy" and unit.get("TIDY") != "yes":
|
|
|
- # Graph is not prepared
|
|
|
- return
|
|
|
+ elif flat_args[1] == "clang_tidy" and unit.get("TIDY") != "yes":
|
|
|
+ # Graph is not prepared
|
|
|
+ return
|
|
|
elif flat_args[1] == "no.test":
|
|
|
return
|
|
|
- test_size = ''.join(spec_args.get('SIZE', [])) or unit.get('TEST_SIZE_NAME') or ''
|
|
|
- test_tags = serialize_list(_get_test_tags(unit, spec_args))
|
|
|
- test_timeout = ''.join(spec_args.get('TIMEOUT', [])) or unit.get('TEST_TIMEOUT') or ''
|
|
|
- test_requirements = spec_args.get('REQUIREMENTS', []) + get_values_list(unit, 'TEST_REQUIREMENTS_VALUE')
|
|
|
-
|
|
|
- if flat_args[1] != "clang_tidy" and unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- if flat_args[1] in ("unittest.py", "gunittest", "g_benchmark"):
|
|
|
- flat_args[1] = "clang_tidy"
|
|
|
- test_size = 'SMALL'
|
|
|
- test_tags = ''
|
|
|
- test_timeout = "60"
|
|
|
- test_requirements = []
|
|
|
- unit.set(["TEST_YT_SPEC_VALUE", ""])
|
|
|
- else:
|
|
|
- return
|
|
|
-
|
|
|
- if flat_args[1] == "clang_tidy" and unit.get("TIDY") == "yes":
|
|
|
- if unit.get("TIDY_CONFIG"):
|
|
|
- default_config_path = unit.get("TIDY_CONFIG")
|
|
|
- project_config_path = unit.get("TIDY_CONFIG")
|
|
|
- else:
|
|
|
- default_config_path = get_default_tidy_config(unit)
|
|
|
- project_config_path = get_project_tidy_config(unit)
|
|
|
-
|
|
|
- unit.set(["DEFAULT_TIDY_CONFIG", default_config_path])
|
|
|
- unit.set(["PROJECT_TIDY_CONFIG", project_config_path])
|
|
|
-
|
|
|
+ test_size = ''.join(spec_args.get('SIZE', [])) or unit.get('TEST_SIZE_NAME') or ''
|
|
|
+ test_tags = serialize_list(_get_test_tags(unit, spec_args))
|
|
|
+ test_timeout = ''.join(spec_args.get('TIMEOUT', [])) or unit.get('TEST_TIMEOUT') or ''
|
|
|
+ test_requirements = spec_args.get('REQUIREMENTS', []) + get_values_list(unit, 'TEST_REQUIREMENTS_VALUE')
|
|
|
+
|
|
|
+ if flat_args[1] != "clang_tidy" and unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ if flat_args[1] in ("unittest.py", "gunittest", "g_benchmark"):
|
|
|
+ flat_args[1] = "clang_tidy"
|
|
|
+ test_size = 'SMALL'
|
|
|
+ test_tags = ''
|
|
|
+ test_timeout = "60"
|
|
|
+ test_requirements = []
|
|
|
+ unit.set(["TEST_YT_SPEC_VALUE", ""])
|
|
|
+ else:
|
|
|
+ return
|
|
|
+
|
|
|
+ if flat_args[1] == "clang_tidy" and unit.get("TIDY") == "yes":
|
|
|
+ if unit.get("TIDY_CONFIG"):
|
|
|
+ default_config_path = unit.get("TIDY_CONFIG")
|
|
|
+ project_config_path = unit.get("TIDY_CONFIG")
|
|
|
+ else:
|
|
|
+ default_config_path = get_default_tidy_config(unit)
|
|
|
+ project_config_path = get_project_tidy_config(unit)
|
|
|
+
|
|
|
+ unit.set(["DEFAULT_TIDY_CONFIG", default_config_path])
|
|
|
+ unit.set(["PROJECT_TIDY_CONFIG", project_config_path])
|
|
|
+
|
|
|
fork_mode = []
|
|
|
if 'FORK_SUBTESTS' in spec_args:
|
|
|
fork_mode.append('subtests')
|
|
@@ -482,18 +482,18 @@ def onadd_ytest(unit, *args):
|
|
|
# TODO get rid of BUILD-FOLDER-PATH
|
|
|
'BUILD-FOLDER-PATH': unit_path,
|
|
|
'BINARY-PATH': "{}/{}".format(unit_path, unit.filename()),
|
|
|
- 'GLOBAL-LIBRARY-PATH': unit.global_filename(),
|
|
|
+ 'GLOBAL-LIBRARY-PATH': unit.global_filename(),
|
|
|
'CUSTOM-DEPENDENCIES': ' '.join(spec_args.get('DEPENDS', []) + get_values_list(unit, 'TEST_DEPENDS_VALUE')),
|
|
|
'TEST-RECIPES': prepare_recipes(unit.get("TEST_RECIPES_VALUE")),
|
|
|
'TEST-ENV': prepare_env(unit.get("TEST_ENV_VALUE")),
|
|
|
# 'TEST-PRESERVE-ENV': 'da',
|
|
|
'TEST-DATA': serialize_list(test_data),
|
|
|
- 'TEST-TIMEOUT': test_timeout,
|
|
|
+ 'TEST-TIMEOUT': test_timeout,
|
|
|
'FORK-MODE': fork_mode,
|
|
|
'SPLIT-FACTOR': ''.join(spec_args.get('SPLIT_FACTOR', [])) or unit.get('TEST_SPLIT_FACTOR') or '',
|
|
|
- 'SIZE': test_size,
|
|
|
- 'TAG': test_tags,
|
|
|
- 'REQUIREMENTS': serialize_list(test_requirements),
|
|
|
+ 'SIZE': test_size,
|
|
|
+ 'TAG': test_tags,
|
|
|
+ 'REQUIREMENTS': serialize_list(test_requirements),
|
|
|
'TEST-CWD': unit.get('TEST_CWD_VALUE') or '',
|
|
|
'FUZZ-DICTS': serialize_list(spec_args.get('FUZZ_DICTS', []) + get_unit_list_variable(unit, 'FUZZ_DICTS_VALUE')),
|
|
|
'FUZZ-OPTS': serialize_list(spec_args.get('FUZZ_OPTS', []) + get_unit_list_variable(unit, 'FUZZ_OPTS_VALUE')),
|
|
@@ -503,16 +503,16 @@ def onadd_ytest(unit, *args):
|
|
|
'TEST_IOS_DEVICE_TYPE': unit.get('TEST_IOS_DEVICE_TYPE_VALUE') or '',
|
|
|
'TEST_IOS_RUNTIME_TYPE': unit.get('TEST_IOS_RUNTIME_TYPE_VALUE') or '',
|
|
|
'ANDROID_APK_TEST_ACTIVITY': unit.get('ANDROID_APK_TEST_ACTIVITY_VALUE') or '',
|
|
|
- 'TEST_PARTITION': unit.get("TEST_PARTITION") or 'SEQUENTIAL',
|
|
|
- 'GO_BENCH_TIMEOUT': unit.get('GO_BENCH_TIMEOUT') or '',
|
|
|
+ 'TEST_PARTITION': unit.get("TEST_PARTITION") or 'SEQUENTIAL',
|
|
|
+ 'GO_BENCH_TIMEOUT': unit.get('GO_BENCH_TIMEOUT') or '',
|
|
|
}
|
|
|
|
|
|
- if flat_args[1] == "go.bench":
|
|
|
- if "ya:run_go_benchmark" not in test_record["TAG"]:
|
|
|
- return
|
|
|
- else:
|
|
|
- test_record["TEST-NAME"] += "_bench"
|
|
|
-
|
|
|
+ if flat_args[1] == "go.bench":
|
|
|
+ if "ya:run_go_benchmark" not in test_record["TAG"]:
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ test_record["TEST-NAME"] += "_bench"
|
|
|
+
|
|
|
if flat_args[1] == 'fuzz.test' and unit.get('FUZZING') == 'yes':
|
|
|
test_record['FUZZING'] = '1'
|
|
|
# use all cores if fuzzing requested
|
|
@@ -544,9 +544,9 @@ def java_srcdirs_to_data(unit, var):
|
|
|
|
|
|
|
|
|
def onadd_check(unit, *args):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
flat_args, spec_args = _common.sort_by_keywords({"DEPENDS": -1, "TIMEOUT": 1, "DATA": -1, "TAG": -1, "REQUIREMENTS": -1, "FORK_MODE": 1,
|
|
|
"SPLIT_FACTOR": 1, "FORK_SUBTESTS": 0, "FORK_TESTS": 0, "SIZE": 1}, args)
|
|
|
check_type = flat_args[0]
|
|
@@ -593,26 +593,26 @@ def onadd_check(unit, *args):
|
|
|
script_rel_path = check_type
|
|
|
|
|
|
use_arcadia_python = unit.get('USE_ARCADIA_PYTHON')
|
|
|
- uid_ext = ''
|
|
|
+ uid_ext = ''
|
|
|
if check_type in ("check.data", "check.resource"):
|
|
|
- if unit.get("VALIDATE_DATA") == "no":
|
|
|
- return
|
|
|
+ if unit.get("VALIDATE_DATA") == "no":
|
|
|
+ return
|
|
|
if check_type == "check.data":
|
|
|
- uid_ext = unit.get("SBR_UID_EXT").split(" ", 1)[-1] # strip variable name
|
|
|
- data_re = re.compile(r"sbr:/?/?(\d+)=?.*")
|
|
|
- data = flat_args[1:]
|
|
|
- resources = []
|
|
|
- for f in data:
|
|
|
- matched = re.match(data_re, f)
|
|
|
- if matched:
|
|
|
- resources.append(matched.group(1))
|
|
|
- if resources:
|
|
|
- test_files = serialize_list(resources)
|
|
|
- else:
|
|
|
- return
|
|
|
- else:
|
|
|
- test_files = serialize_list(flat_args[1:])
|
|
|
-
|
|
|
+ uid_ext = unit.get("SBR_UID_EXT").split(" ", 1)[-1] # strip variable name
|
|
|
+ data_re = re.compile(r"sbr:/?/?(\d+)=?.*")
|
|
|
+ data = flat_args[1:]
|
|
|
+ resources = []
|
|
|
+ for f in data:
|
|
|
+ matched = re.match(data_re, f)
|
|
|
+ if matched:
|
|
|
+ resources.append(matched.group(1))
|
|
|
+ if resources:
|
|
|
+ test_files = serialize_list(resources)
|
|
|
+ else:
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ test_files = serialize_list(flat_args[1:])
|
|
|
+
|
|
|
test_record = {
|
|
|
'TEST-NAME': check_type.lower(),
|
|
|
'TEST-TIMEOUT': test_timeout,
|
|
@@ -621,9 +621,9 @@ def onadd_check(unit, *args):
|
|
|
'SOURCE-FOLDER-PATH': test_dir,
|
|
|
'CUSTOM-DEPENDENCIES': " ".join(spec_args.get('DEPENDS', [])),
|
|
|
'TEST-DATA': extra_test_data,
|
|
|
- "SBR-UID-EXT": uid_ext,
|
|
|
+ "SBR-UID-EXT": uid_ext,
|
|
|
'SPLIT-FACTOR': '',
|
|
|
- 'TEST_PARTITION': 'SEQUENTIAL',
|
|
|
+ 'TEST_PARTITION': 'SEQUENTIAL',
|
|
|
'FORK-MODE': fork_mode,
|
|
|
'FORK-TEST-FILES': '',
|
|
|
'SIZE': 'SMALL',
|
|
@@ -652,9 +652,9 @@ def on_register_no_check_imports(unit):
|
|
|
|
|
|
|
|
|
def onadd_check_py_imports(unit, *args):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
if unit.get('NO_CHECK_IMPORTS_FOR_VALUE').strip() == "":
|
|
|
return
|
|
|
unit.onpeerdir(['library/python/testing/import_test'])
|
|
@@ -673,7 +673,7 @@ def onadd_check_py_imports(unit, *args):
|
|
|
'TEST-DATA': '',
|
|
|
'TEST-ENV': prepare_env(unit.get("TEST_ENV_VALUE")),
|
|
|
'SPLIT-FACTOR': '',
|
|
|
- 'TEST_PARTITION': 'SEQUENTIAL',
|
|
|
+ 'TEST_PARTITION': 'SEQUENTIAL',
|
|
|
'FORK-MODE': '',
|
|
|
'FORK-TEST-FILES': '',
|
|
|
'SIZE': 'SMALL',
|
|
@@ -696,13 +696,13 @@ def onadd_check_py_imports(unit, *args):
|
|
|
|
|
|
|
|
|
def onadd_pytest_script(unit, *args):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
unit.set(["PYTEST_BIN", "no"])
|
|
|
custom_deps = get_values_list(unit, 'TEST_DEPENDS_VALUE')
|
|
|
timeout = filter(None, [unit.get(["TEST_TIMEOUT"])])
|
|
|
-
|
|
|
+
|
|
|
if timeout:
|
|
|
timeout = timeout[0]
|
|
|
else:
|
|
@@ -725,9 +725,9 @@ def onadd_pytest_script(unit, *args):
|
|
|
|
|
|
|
|
|
def onadd_pytest_bin(unit, *args):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
flat, kws = _common.sort_by_keywords({'RUNNER_BIN': 1}, args)
|
|
|
if flat:
|
|
|
ymake.report_configure_error(
|
|
@@ -742,9 +742,9 @@ def onadd_pytest_bin(unit, *args):
|
|
|
|
|
|
|
|
|
def add_test_to_dart(unit, test_type, binary_path=None, runner_bin=None):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
custom_deps = get_values_list(unit, 'TEST_DEPENDS_VALUE')
|
|
|
timeout = filter(None, [unit.get(["TEST_TIMEOUT"])])
|
|
|
if timeout:
|
|
@@ -793,10 +793,10 @@ def extract_java_system_properties(unit, args):
|
|
|
|
|
|
|
|
|
def onjava_test(unit, *args):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
-
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
+
|
|
|
assert unit.get('MODULE_TYPE') is not None
|
|
|
|
|
|
if unit.get('MODULE_TYPE') == 'JTEST_FOR':
|
|
@@ -884,10 +884,10 @@ def onjava_test(unit, *args):
|
|
|
|
|
|
|
|
|
def onjava_test_deps(unit, *args):
|
|
|
- if unit.get("TIDY") == "yes":
|
|
|
- # graph changed for clang_tidy tests
|
|
|
- return
|
|
|
-
|
|
|
+ if unit.get("TIDY") == "yes":
|
|
|
+ # graph changed for clang_tidy tests
|
|
|
+ return
|
|
|
+
|
|
|
assert unit.get('MODULE_TYPE') is not None
|
|
|
assert len(args) == 1
|
|
|
mode = args[0]
|
|
@@ -902,7 +902,7 @@ def onjava_test_deps(unit, *args):
|
|
|
'TEST-TIMEOUT': '',
|
|
|
'TESTED-PROJECT-NAME': path,
|
|
|
'TEST-DATA': '',
|
|
|
- 'TEST_PARTITION': 'SEQUENTIAL',
|
|
|
+ 'TEST_PARTITION': 'SEQUENTIAL',
|
|
|
'FORK-MODE': '',
|
|
|
'SPLIT-FACTOR': '',
|
|
|
'CUSTOM-DEPENDENCIES': ' '.join(get_values_list(unit, 'TEST_DEPENDS_VALUE')),
|
|
@@ -971,45 +971,45 @@ def _dump_test(
|
|
|
use_arcadia_python = unit.get('USE_ARCADIA_PYTHON')
|
|
|
if test_cwd:
|
|
|
test_cwd = test_cwd.replace("$TEST_CWD_VALUE", "").replace('"MACRO_CALLS_DELIM"', "").strip()
|
|
|
- test_name = os.path.basename(binary_path)
|
|
|
- test_record = {
|
|
|
- 'TEST-NAME': os.path.splitext(test_name)[0],
|
|
|
- 'TEST-TIMEOUT': timeout,
|
|
|
- 'SCRIPT-REL-PATH': script_rel_path,
|
|
|
- 'TESTED-PROJECT-NAME': test_name,
|
|
|
- 'SOURCE-FOLDER-PATH': test_dir,
|
|
|
- 'CUSTOM-DEPENDENCIES': " ".join(custom_deps),
|
|
|
- 'TEST-ENV': prepare_env(unit.get("TEST_ENV_VALUE")),
|
|
|
- # 'TEST-PRESERVE-ENV': 'da',
|
|
|
- 'TEST-DATA': serialize_list(sorted(_common.filter_out_by_keyword(test_data, 'AUTOUPDATED'))),
|
|
|
- 'TEST-RECIPES': prepare_recipes(unit.get("TEST_RECIPES_VALUE")),
|
|
|
- 'SPLIT-FACTOR': split_factor,
|
|
|
- 'TEST_PARTITION': unit.get('TEST_PARTITION') or 'SEQUENTIAL',
|
|
|
- 'FORK-MODE': fork_mode,
|
|
|
- 'FORK-TEST-FILES': fork_test_files,
|
|
|
- 'TEST-FILES': serialize_list(test_files),
|
|
|
- 'SIZE': test_size,
|
|
|
- 'TAG': serialize_list(tags),
|
|
|
- 'REQUIREMENTS': serialize_list(requirements),
|
|
|
- 'USE_ARCADIA_PYTHON': use_arcadia_python or '',
|
|
|
- 'OLD_PYTEST': 'yes' if old_pytest else 'no',
|
|
|
- 'PYTHON-PATHS': serialize_list(python_paths),
|
|
|
- 'TEST-CWD': test_cwd or '',
|
|
|
- 'SKIP_TEST': unit.get('SKIP_TEST_VALUE') or '',
|
|
|
- 'BUILD-FOLDER-PATH': _common.strip_roots(unit_path),
|
|
|
- 'BLOB': unit.get('TEST_BLOB_DATA') or '',
|
|
|
- 'CANONIZE_SUB_PATH': unit.get('CANONIZE_SUB_PATH') or '',
|
|
|
- }
|
|
|
+ test_name = os.path.basename(binary_path)
|
|
|
+ test_record = {
|
|
|
+ 'TEST-NAME': os.path.splitext(test_name)[0],
|
|
|
+ 'TEST-TIMEOUT': timeout,
|
|
|
+ 'SCRIPT-REL-PATH': script_rel_path,
|
|
|
+ 'TESTED-PROJECT-NAME': test_name,
|
|
|
+ 'SOURCE-FOLDER-PATH': test_dir,
|
|
|
+ 'CUSTOM-DEPENDENCIES': " ".join(custom_deps),
|
|
|
+ 'TEST-ENV': prepare_env(unit.get("TEST_ENV_VALUE")),
|
|
|
+ # 'TEST-PRESERVE-ENV': 'da',
|
|
|
+ 'TEST-DATA': serialize_list(sorted(_common.filter_out_by_keyword(test_data, 'AUTOUPDATED'))),
|
|
|
+ 'TEST-RECIPES': prepare_recipes(unit.get("TEST_RECIPES_VALUE")),
|
|
|
+ 'SPLIT-FACTOR': split_factor,
|
|
|
+ 'TEST_PARTITION': unit.get('TEST_PARTITION') or 'SEQUENTIAL',
|
|
|
+ 'FORK-MODE': fork_mode,
|
|
|
+ 'FORK-TEST-FILES': fork_test_files,
|
|
|
+ 'TEST-FILES': serialize_list(test_files),
|
|
|
+ 'SIZE': test_size,
|
|
|
+ 'TAG': serialize_list(tags),
|
|
|
+ 'REQUIREMENTS': serialize_list(requirements),
|
|
|
+ 'USE_ARCADIA_PYTHON': use_arcadia_python or '',
|
|
|
+ 'OLD_PYTEST': 'yes' if old_pytest else 'no',
|
|
|
+ 'PYTHON-PATHS': serialize_list(python_paths),
|
|
|
+ 'TEST-CWD': test_cwd or '',
|
|
|
+ 'SKIP_TEST': unit.get('SKIP_TEST_VALUE') or '',
|
|
|
+ 'BUILD-FOLDER-PATH': _common.strip_roots(unit_path),
|
|
|
+ 'BLOB': unit.get('TEST_BLOB_DATA') or '',
|
|
|
+ 'CANONIZE_SUB_PATH': unit.get('CANONIZE_SUB_PATH') or '',
|
|
|
+ }
|
|
|
if binary_path:
|
|
|
- test_record['BINARY-PATH'] = _common.strip_roots(binary_path)
|
|
|
- if runner_bin:
|
|
|
- test_record['TEST-RUNNER-BIN'] = runner_bin
|
|
|
- if yt_spec:
|
|
|
- test_record['YT-SPEC'] = serialize_list(yt_spec)
|
|
|
- data = dump_test(unit, test_record)
|
|
|
- if data:
|
|
|
- unit.set_property(["DART_DATA", data])
|
|
|
- save_in_file(unit.get('TEST_DART_OUT_FILE'), data)
|
|
|
+ test_record['BINARY-PATH'] = _common.strip_roots(binary_path)
|
|
|
+ if runner_bin:
|
|
|
+ test_record['TEST-RUNNER-BIN'] = runner_bin
|
|
|
+ if yt_spec:
|
|
|
+ test_record['YT-SPEC'] = serialize_list(yt_spec)
|
|
|
+ data = dump_test(unit, test_record)
|
|
|
+ if data:
|
|
|
+ unit.set_property(["DART_DATA", data])
|
|
|
+ save_in_file(unit.get('TEST_DART_OUT_FILE'), data)
|
|
|
|
|
|
|
|
|
def onsetup_pytest_bin(unit, *args):
|