aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriaz1607 <iaz1607@yandex-team.com>2024-06-14 11:06:29 +0300
committeriaz1607 <iaz1607@yandex-team.com>2024-06-14 11:22:09 +0300
commit84c73495689866bd2e5e797da82d217f568c5ce1 (patch)
tree27bb7bb08193f69161aae1683ddd1b75dda3055f
parentc088fcd1c5a6e29a0cf76029ba9c8bb09d2f8615 (diff)
downloadydb-84c73495689866bd2e5e797da82d217f568c5ce1.tar.gz
Fix tidy
В https://a.yandex-team.ru/arcadia/commit/rXXXXXX мы стали запускать тайдинг для всего питона. в этом PR фикс. чуть подробнее тут https://st.yandex-team.ru/#66619a1cef58eb2de9918702 3acfe69bcd47502d38bc51e83ba936407992d875
-rw-r--r--build/conf/python.conf4
-rw-r--r--build/plugins/ytest.py63
2 files changed, 7 insertions, 60 deletions
diff --git a/build/conf/python.conf b/build/conf/python.conf
index f1b25a2e36..46df139ed4 100644
--- a/build/conf/python.conf
+++ b/build/conf/python.conf
@@ -222,7 +222,6 @@ multimodule PY3_PROGRAM {
# Notify pybuild to skip almost all PY_SRCS arguments except MAIN
ENABLE(PROCESS_PY_MAIN_ONLY)
_PY_PROGRAM()
- NO_CLANG_TIDY()
}
module PY3_BIN_LIB: PY3_LIBRARY {
@@ -315,7 +314,7 @@ module PY2TEST: PYTEST_BIN {
ASSERT(_OK You are using deprecated Python2-only code (PY2TEST). Please consider rewriting to Python 3.)
SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json)
-
+ NO_CLANG_TIDY()
_DONT_REQUIRE_LICENSE()
}
@@ -693,6 +692,7 @@ module _BASE_PY3_PROGRAM: _BASE_PROGRAM {
when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") {
NO_CHECK_IMPORTS_FOR_VALUE=
}
+ NO_CLANG_TIDY()
ADD_CHECK_PY_IMPORTS()
when ($ARCH_PPC64LE == "yes") {
diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py
index d631f21ac3..d7b47b69af 100644
--- a/build/plugins/ytest.py
+++ b/build/plugins/ytest.py
@@ -1384,7 +1384,7 @@ def on_add_linter_check(unit, *args):
unit.set_property(["DART_DATA", data])
-def clang_tidy(unit, *args, from_other_type=False):
+def clang_tidy(unit, *args):
keywords = {
"DEPENDS": -1,
"DATA": -1,
@@ -1396,34 +1396,6 @@ def clang_tidy(unit, *args, from_other_type=False):
}
flat_args, spec_args = _common.sort_by_keywords(keywords, args)
- # TODO see if we can get rid of 'from_other_type' parameter
- if from_other_type:
- if unit.get('ADD_SRCDIR_TO_TEST_DATA') == "yes":
- unit.ondata_files(_common.get_norm_unit_path(unit))
-
- if flat_args[1] == "boost.test":
- unit.ondata_files(get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE'))
-
- flat_args[1] = "clang_tidy"
- test_size = 'SMALL'
- test_tags = ''
- test_timeout = "60"
- test_requirements = []
- unit.set(["TEST_YT_SPEC_VALUE", ""])
- else:
- unit.ondata_files(get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE'))
-
- test_size = ''.join(spec_args.get('SIZE', [])) or unit.get('TEST_SIZE_NAME')
- test_tags = serialize_list(sorted(_get_test_tags(unit, spec_args)))
- test_timeout = ''.join(spec_args.get('TIMEOUT', [])) or unit.get('TEST_TIMEOUT')
- test_requirements = spec_args.get('REQUIREMENTS', []) + get_values_list(unit, 'TEST_REQUIREMENTS_VALUE')
-
- test_data = sorted(
- _common.filter_out_by_keyword(
- spec_args.get('DATA', []) + get_norm_paths(unit, 'TEST_DATA_VALUE'), 'AUTOUPDATED'
- )
- )
-
if unit.get("TIDY_CONFIG"):
default_config_path = unit.get("TIDY_CONFIG")
project_config_path = unit.get("TIDY_CONFIG")
@@ -1434,14 +1406,6 @@ def clang_tidy(unit, *args, from_other_type=False):
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')
- if 'FORK_TESTS' in spec_args:
- fork_mode.append('tests')
- fork_mode = fork_mode or spec_args.get('FORK_MODE', []) or unit.get('TEST_FORK_MODE').split()
- fork_mode = ' '.join(fork_mode) if fork_mode else ''
-
unit_path = _common.get_norm_unit_path(unit)
test_record = {
@@ -1458,15 +1422,8 @@ def clang_tidy(unit, *args, from_other_type=False):
'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(sorted(test_data)),
- 'TEST-TIMEOUT': test_timeout,
- 'FORK-MODE': fork_mode,
'SPLIT-FACTOR': ''.join(spec_args.get('SPLIT_FACTOR', [])) or unit.get('TEST_SPLIT_FACTOR'),
- 'SIZE': test_size,
- 'TAG': test_tags,
- 'REQUIREMENTS': serialize_list(test_requirements),
'TEST-CWD': unit.get('TEST_CWD_VALUE'),
- 'YT-SPEC': serialize_list(spec_args.get('YT_SPEC', []) + get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE')),
'SKIP_TEST': unit.get('SKIP_TEST_VALUE'),
'TEST_IOS_DEVICE_TYPE': unit.get('TEST_IOS_DEVICE_TYPE_VALUE'),
'TEST_IOS_RUNTIME_TYPE': unit.get('TEST_IOS_RUNTIME_TYPE_VALUE'),
@@ -2178,23 +2135,13 @@ def onadd_ytest(unit, *args):
flat_args, *_ = _common.sort_by_keywords(keywords, args)
test_type = flat_args[1]
- if unit.get("TIDY_ENABLED") == "yes" and test_type in (
- "unittest.py",
- "gunittest",
- "g_benchmark",
- "boost.test",
- ):
- clang_tidy(unit, *args, from_other_type=True)
- elif unit.get("TIDY_ENABLED") == "yes" and test_type not in (
- "clang_tidy",
- "unittest.py",
- "gunittest",
- "g_benchmark",
- "boost.test",
- ):
+ # TIDY not supported for module
+ if unit.get("TIDY_ENABLED") == "yes" and test_type != "clang_tidy":
return
+ # TIDY explicitly disabled for module in ymake.core.conf
elif test_type == "clang_tidy" and unit.get("TIDY_ENABLED") != "yes":
return
+ # TIDY disabled for module in ya.make
elif unit.get("TIDY") == "yes" and unit.get("TIDY_ENABLED") != "yes":
return
elif test_type == "no.test":