aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins
diff options
context:
space:
mode:
authorakastornov <akastornov@yandex-team.ru>2022-02-10 16:46:03 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:03 +0300
commit3a2de774d91ca8d7325aaf81c200b1d2047725e6 (patch)
tree5674a780ce03a8bbd794733a19c7a70d587e4a14 /build/plugins
parent7bd11ff35e97544d119e43447e3e865f2588ee7f (diff)
downloadydb-3a2de774d91ca8d7325aaf81c200b1d2047725e6.tar.gz
Restoring authorship annotation for <akastornov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/plugins')
-rw-r--r--build/plugins/java.py192
-rw-r--r--build/plugins/pybuild.py4
-rw-r--r--build/plugins/scarab_cant_clash.py114
-rw-r--r--build/plugins/ytest.py112
4 files changed, 211 insertions, 211 deletions
diff --git a/build/plugins/java.py b/build/plugins/java.py
index 16fc1267348..309d98bc9d1 100644
--- a/build/plugins/java.py
+++ b/build/plugins/java.py
@@ -1,43 +1,43 @@
-import _common as common
+import _common as common
import ymake
-import json
+import json
import os
-import base64
-
-
-DELIM = '================================'
-
-
-def split_args(s): # TODO quotes, escapes
- return filter(None, s.split())
-
-
-def extract_macro_calls(unit, macro_value_name, macro_calls_delim):
- if not unit.get(macro_value_name):
- return []
-
- return filter(None, map(split_args, unit.get(macro_value_name).replace('$' + macro_value_name, '').split(macro_calls_delim)))
-
-
-def extract_macro_calls2(unit, macro_value_name):
- if not unit.get(macro_value_name):
- return []
-
- calls = []
- for call_encoded_args in unit.get(macro_value_name).strip().split():
- call_args = json.loads(base64.b64decode(call_encoded_args), encoding='utf-8')
- calls.append(call_args)
-
- return calls
-
-
+import base64
+
+
+DELIM = '================================'
+
+
+def split_args(s): # TODO quotes, escapes
+ return filter(None, s.split())
+
+
+def extract_macro_calls(unit, macro_value_name, macro_calls_delim):
+ if not unit.get(macro_value_name):
+ return []
+
+ return filter(None, map(split_args, unit.get(macro_value_name).replace('$' + macro_value_name, '').split(macro_calls_delim)))
+
+
+def extract_macro_calls2(unit, macro_value_name):
+ if not unit.get(macro_value_name):
+ return []
+
+ calls = []
+ for call_encoded_args in unit.get(macro_value_name).strip().split():
+ call_args = json.loads(base64.b64decode(call_encoded_args), encoding='utf-8')
+ calls.append(call_args)
+
+ return calls
+
+
def on_run_jbuild_program(unit, *args):
args = list(args)
"""
Custom code generation
@link: https://wiki.yandex-team.ru/yatool/java/#kodogeneracijarunjavaprogram
"""
-
+
flat, kv = common.sort_by_keywords({'IN': -1, 'IN_DIR': -1, 'OUT': -1, 'OUT_DIR': -1, 'CWD': 1, 'CLASSPATH': -1, 'CP_USE_COMMAND_FILE': 1, 'ADD_SRCS_TO_CLASSPATH': 0}, args)
depends = kv.get('CLASSPATH', []) + kv.get('JAR', [])
fake_out = None
@@ -45,18 +45,18 @@ def on_run_jbuild_program(unit, *args):
# XXX: hack to force ymake to build dependencies
fake_out = "fake.out.{}".format(hash(tuple(args)))
unit.on_run_java(['TOOL'] + depends + ["OUT", fake_out])
-
+
if not kv.get('CP_USE_COMMAND_FILE'):
args += ['CP_USE_COMMAND_FILE', unit.get(['JAVA_PROGRAM_CP_USE_COMMAND_FILE']) or 'yes']
if fake_out is not None:
args += ['FAKE_OUT', fake_out]
- prev = unit.get(['RUN_JAVA_PROGRAM_VALUE']) or ''
- new_val = (prev + ' ' + base64.b64encode(json.dumps(list(args), encoding='utf-8'))).strip()
- unit.set(['RUN_JAVA_PROGRAM_VALUE', new_val])
-
-
+ prev = unit.get(['RUN_JAVA_PROGRAM_VALUE']) or ''
+ new_val = (prev + ' ' + base64.b64encode(json.dumps(list(args), encoding='utf-8'))).strip()
+ unit.set(['RUN_JAVA_PROGRAM_VALUE', new_val])
+
+
def ongenerate_script(unit, *args):
"""
heretic@ promised to make tutorial here
@@ -74,48 +74,48 @@ def ongenerate_script(unit, *args):
unit.set(['GENERATE_SCRIPT_VALUE', new_val])
-def onjava_module(unit, *args):
- args_delim = unit.get('ARGS_DELIM')
+def onjava_module(unit, *args):
+ args_delim = unit.get('ARGS_DELIM')
idea_only = True if 'IDEA_ONLY' in args else False
-
+
if idea_only:
if unit.get('YA_IDE_IDEA') != 'yes':
return
if unit.get('YMAKE_JAVA_MODULES') != 'yes':
return
- data = {
+ data = {
'BUNDLE_NAME': unit.name(),
- 'PATH': unit.path(),
+ 'PATH': unit.path(),
'IDEA_ONLY': 'yes' if idea_only else 'no',
- 'MODULE_TYPE': unit.get('MODULE_TYPE'),
- 'MODULE_ARGS': unit.get('MODULE_ARGS'),
+ 'MODULE_TYPE': unit.get('MODULE_TYPE'),
+ 'MODULE_ARGS': unit.get('MODULE_ARGS'),
'MANAGED_PEERS': '${MANAGED_PEERS}',
'MANAGED_PEERS_CLOSURE': '${MANAGED_PEERS_CLOSURE}',
'NON_NAMAGEABLE_PEERS': '${NON_NAMAGEABLE_PEERS}',
'TEST_CLASSPATH_MANAGED': '${TEST_CLASSPATH_MANAGED}',
- 'EXCLUDE': extract_macro_calls(unit, 'EXCLUDE_VALUE', args_delim),
- 'JAVA_SRCS': extract_macro_calls(unit, 'JAVA_SRCS_VALUE', args_delim),
- 'JAVAC_FLAGS': extract_macro_calls(unit, 'JAVAC_FLAGS_VALUE', args_delim),
- 'ANNOTATION_PROCESSOR': extract_macro_calls(unit, 'ANNOTATION_PROCESSOR_VALUE', args_delim),
- 'EXTERNAL_JAR': extract_macro_calls(unit, 'EXTERNAL_JAR_VALUE', args_delim),
- 'RUN_JAVA_PROGRAM': extract_macro_calls2(unit, 'RUN_JAVA_PROGRAM_VALUE'),
+ 'EXCLUDE': extract_macro_calls(unit, 'EXCLUDE_VALUE', args_delim),
+ 'JAVA_SRCS': extract_macro_calls(unit, 'JAVA_SRCS_VALUE', args_delim),
+ 'JAVAC_FLAGS': extract_macro_calls(unit, 'JAVAC_FLAGS_VALUE', args_delim),
+ 'ANNOTATION_PROCESSOR': extract_macro_calls(unit, 'ANNOTATION_PROCESSOR_VALUE', args_delim),
+ 'EXTERNAL_JAR': extract_macro_calls(unit, 'EXTERNAL_JAR_VALUE', args_delim),
+ 'RUN_JAVA_PROGRAM': extract_macro_calls2(unit, 'RUN_JAVA_PROGRAM_VALUE'),
'RUN_JAVA_PROGRAM_MANAGED': '${RUN_JAVA_PROGRAM_MANAGED}',
'MAVEN_GROUP_ID': extract_macro_calls(unit, 'MAVEN_GROUP_ID_VALUE', args_delim),
'JAR_INCLUDE_FILTER': extract_macro_calls(unit, 'JAR_INCLUDE_FILTER_VALUE', args_delim),
'JAR_EXCLUDE_FILTER': extract_macro_calls(unit, 'JAR_EXCLUDE_FILTER_VALUE', args_delim),
-
- # TODO remove when java test dart is in prod
- 'UNITTEST_DIR': unit.get('UNITTEST_DIR'),
- 'SYSTEM_PROPERTIES': extract_macro_calls(unit, 'SYSTEM_PROPERTIES_VALUE', args_delim),
- 'JVM_ARGS': extract_macro_calls(unit, 'JVM_ARGS_VALUE', args_delim),
- 'TEST_CWD': extract_macro_calls(unit, 'TEST_CWD_VALUE', args_delim),
- 'TEST_DATA': extract_macro_calls(unit, '__test_data', args_delim),
- 'TEST_FORK_MODE': extract_macro_calls(unit, 'TEST_FORK_MODE', args_delim),
- 'SPLIT_FACTOR': extract_macro_calls(unit, 'TEST_SPLIT_FACTOR', args_delim),
- 'TIMEOUT': extract_macro_calls(unit, 'TEST_TIMEOUT', args_delim),
- 'TAG': extract_macro_calls(unit, 'TEST_TAGS_VALUE', args_delim),
- 'SIZE': extract_macro_calls(unit, 'TEST_SIZE_NAME', args_delim),
+
+ # TODO remove when java test dart is in prod
+ 'UNITTEST_DIR': unit.get('UNITTEST_DIR'),
+ 'SYSTEM_PROPERTIES': extract_macro_calls(unit, 'SYSTEM_PROPERTIES_VALUE', args_delim),
+ 'JVM_ARGS': extract_macro_calls(unit, 'JVM_ARGS_VALUE', args_delim),
+ 'TEST_CWD': extract_macro_calls(unit, 'TEST_CWD_VALUE', args_delim),
+ 'TEST_DATA': extract_macro_calls(unit, '__test_data', args_delim),
+ 'TEST_FORK_MODE': extract_macro_calls(unit, 'TEST_FORK_MODE', args_delim),
+ 'SPLIT_FACTOR': extract_macro_calls(unit, 'TEST_SPLIT_FACTOR', args_delim),
+ 'TIMEOUT': extract_macro_calls(unit, 'TEST_TIMEOUT', args_delim),
+ 'TAG': extract_macro_calls(unit, 'TEST_TAGS_VALUE', args_delim),
+ 'SIZE': extract_macro_calls(unit, 'TEST_SIZE_NAME', args_delim),
'DEPENDS': extract_macro_calls(unit, 'TEST_DEPENDS_VALUE', args_delim),
'IDEA_EXCLUDE': extract_macro_calls(unit, 'IDEA_EXCLUDE_DIRS_VALUE', args_delim),
'IDEA_RESOURCE': extract_macro_calls(unit, 'IDEA_RESOURCE_DIRS_VALUE', args_delim),
@@ -125,17 +125,17 @@ def onjava_module(unit, *args):
'TEST_DATA': extract_macro_calls(unit, 'TEST_DATA_VALUE', args_delim),
'JAVA_FORBIDDEN_LIBRARIES': extract_macro_calls(unit, 'JAVA_FORBIDDEN_LIBRARIES_VALUE', args_delim),
'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT')
- }
+ }
if unit.get('ENABLE_PREVIEW_VALUE') == 'yes' and unit.get('JDK_VERSION') in ('15', '16', '17'):
data['ENABLE_PREVIEW'] = extract_macro_calls(unit, 'ENABLE_PREVIEW_VALUE', args_delim)
if unit.get('SAVE_JAVAC_GENERATED_SRCS_DIR') and unit.get('SAVE_JAVAC_GENERATED_SRCS_TAR'):
data['SAVE_JAVAC_GENERATED_SRCS_DIR'] = extract_macro_calls(unit, 'SAVE_JAVAC_GENERATED_SRCS_DIR', args_delim)
data['SAVE_JAVAC_GENERATED_SRCS_TAR'] = extract_macro_calls(unit, 'SAVE_JAVAC_GENERATED_SRCS_TAR', args_delim)
-
+
if unit.get('JAVA_ADD_DLLS_VALUE') == 'yes':
data['ADD_DLLS_FROM_DEPENDS'] = extract_macro_calls(unit, 'JAVA_ADD_DLLS_VALUE', args_delim)
-
+
if unit.get('ERROR_PRONE_VALUE') == 'yes':
data['ERROR_PRONE'] = extract_macro_calls(unit, 'ERROR_PRONE_VALUE', args_delim)
@@ -189,36 +189,36 @@ def onjava_module(unit, *args):
if macro_str and macro_str == 'yes':
data['VCS_INFO_DISABLE_CACHE__NO_UID__'] = macro_val
- for java_srcs_args in data['JAVA_SRCS']:
- external = None
-
- for i in xrange(len(java_srcs_args)):
- arg = java_srcs_args[i]
-
- if arg == 'EXTERNAL':
- if not i + 1 < len(java_srcs_args):
- continue # TODO configure error
-
- ex = java_srcs_args[i + 1]
-
- if ex in ('EXTERNAL', 'SRCDIR', 'PACKAGE_PREFIX', 'EXCLUDE'):
- continue # TODO configure error
-
- if external is not None:
- continue # TODO configure error
-
- external = ex
-
- if external:
- unit.onpeerdir(external)
-
- for k, v in data.items():
- if not v:
- data.pop(k)
-
- dart = 'JAVA_DART: ' + base64.b64encode(json.dumps(data)) + '\n' + DELIM + '\n'
-
- unit.set_property(['JAVA_DART_DATA', dart])
+ for java_srcs_args in data['JAVA_SRCS']:
+ external = None
+
+ for i in xrange(len(java_srcs_args)):
+ arg = java_srcs_args[i]
+
+ if arg == 'EXTERNAL':
+ if not i + 1 < len(java_srcs_args):
+ continue # TODO configure error
+
+ ex = java_srcs_args[i + 1]
+
+ if ex in ('EXTERNAL', 'SRCDIR', 'PACKAGE_PREFIX', 'EXCLUDE'):
+ continue # TODO configure error
+
+ if external is not None:
+ continue # TODO configure error
+
+ external = ex
+
+ if external:
+ unit.onpeerdir(external)
+
+ for k, v in data.items():
+ if not v:
+ data.pop(k)
+
+ dart = 'JAVA_DART: ' + base64.b64encode(json.dumps(data)) + '\n' + DELIM + '\n'
+
+ unit.set_property(['JAVA_DART_DATA', dart])
if not idea_only and unit.get('MODULE_TYPE') in ('JAVA_PROGRAM', 'JAVA_LIBRARY', 'JTEST', 'TESTNG', 'JUNIT5') and not unit.path().startswith('$S/contrib/java'):
unit.on_add_classpath_clash_check()
if unit.get('LINT_LEVEL_VALUE') != "none":
diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py
index f32a2d39a0e..87252f1ba01 100644
--- a/build/plugins/pybuild.py
+++ b/build/plugins/pybuild.py
@@ -498,7 +498,7 @@ def onpy_srcs(unit, *args):
unit.onpeerdir(py_runtime_path)
unit.onpeerdir(unit.get("PY_PROTO_DEPS").split())
-
+
proto_paths = [path for path, mod in protos]
unit.on_generate_py_protos_internal(proto_paths)
unit.onpy_srcs([
@@ -506,7 +506,7 @@ def onpy_srcs(unit, *args):
for path, mod in protos
for py_suf in unit.get("PY_PROTO_SUFFIXES").split()
])
-
+
if optimize_proto and need_gazetteer_peerdir:
unit.onpeerdir(['kernel/gazetteer/proto'])
diff --git a/build/plugins/scarab_cant_clash.py b/build/plugins/scarab_cant_clash.py
index 77dc3031838..5f3dcf6c350 100644
--- a/build/plugins/scarab_cant_clash.py
+++ b/build/plugins/scarab_cant_clash.py
@@ -1,65 +1,65 @@
-import _common as common
-
-
-def onacceleo(unit, *args):
+import _common as common
+
+
+def onacceleo(unit, *args):
if unit.get("YMAKE_JAVA_MODULES") == "yes":
return
- flat, kv = common.sort_by_keywords(
+ flat, kv = common.sort_by_keywords(
{'XSD': -1, 'MTL': -1, 'MTL_ROOT': 1, 'LANG': -1, 'OUT': -1, 'OUT_NOAUTO': -1, 'OUTPUT_INCLUDES': -1, 'DEBUG': 0},
- args
- )
-
- try:
- mtlroot = kv['MTL_ROOT'][0]
- except Exception:
- mtlroot = unit.path().replace('$S/', '')
-
- classpath = ['$SCARAB', ] # XXX special word for ya make to replace following paths with real classpath
- classpath.append('tools/acceleo')
-
+ args
+ )
+
+ try:
+ mtlroot = kv['MTL_ROOT'][0]
+ except Exception:
+ mtlroot = unit.path().replace('$S/', '')
+
+ classpath = ['$SCARAB', ] # XXX special word for ya make to replace following paths with real classpath
+ classpath.append('tools/acceleo')
+
depends = []
- if not unit.get('IDE_MSVS_CALL'):
- for jar in classpath[1:]:
+ if not unit.get('IDE_MSVS_CALL'):
+ for jar in classpath[1:]:
depends.append(jar)
-
- classpath = ':'.join(classpath)
-
- # Generate java cmd
- cmd = [
- '-classpath',
- classpath,
- '-Dfile.encoding=UTF-8',
- 'ru.yandex.se.logsng.tool.Cli',
- ]
-
- for xsd in kv.get('XSD', []):
- cmd += ['--xsd', xsd]
-
- for mtl in kv.get('MTL', []):
- cmd += ['--mtl', mtl]
-
- for lang in kv.get('LANG', []):
- cmd += ['--lang', lang]
-
- cmd += ['--output-dir', unit.path().replace('$S/', '${ARCADIA_BUILD_ROOT}/')]
- cmd += ['--build-root', '${ARCADIA_BUILD_ROOT}']
- cmd += ['--source-root', '${ARCADIA_ROOT}']
- cmd += ['--mtl-root', mtlroot]
-
- # Generate RUN_JAVA args
- run_java = cmd
-
- if 'DEBUG' not in kv:
- run_java += ['HIDE_OUTPUT']
-
- inputs = kv.get('XSD', []) + kv.get('MTL', []) + kv.get('LANG', [])
- if inputs:
- run_java += ['IN'] + inputs
-
- for k in 'OUT', 'OUT_NOAUTO', 'OUTPUT_INCLUDES':
- if kv.get(k):
- run_java += [k] + kv[k]
-
+
+ classpath = ':'.join(classpath)
+
+ # Generate java cmd
+ cmd = [
+ '-classpath',
+ classpath,
+ '-Dfile.encoding=UTF-8',
+ 'ru.yandex.se.logsng.tool.Cli',
+ ]
+
+ for xsd in kv.get('XSD', []):
+ cmd += ['--xsd', xsd]
+
+ for mtl in kv.get('MTL', []):
+ cmd += ['--mtl', mtl]
+
+ for lang in kv.get('LANG', []):
+ cmd += ['--lang', lang]
+
+ cmd += ['--output-dir', unit.path().replace('$S/', '${ARCADIA_BUILD_ROOT}/')]
+ cmd += ['--build-root', '${ARCADIA_BUILD_ROOT}']
+ cmd += ['--source-root', '${ARCADIA_ROOT}']
+ cmd += ['--mtl-root', mtlroot]
+
+ # Generate RUN_JAVA args
+ run_java = cmd
+
+ if 'DEBUG' not in kv:
+ run_java += ['HIDE_OUTPUT']
+
+ inputs = kv.get('XSD', []) + kv.get('MTL', []) + kv.get('LANG', [])
+ if inputs:
+ run_java += ['IN'] + inputs
+
+ for k in 'OUT', 'OUT_NOAUTO', 'OUTPUT_INCLUDES':
+ if kv.get(k):
+ run_java += [k] + kv[k]
+
if depends:
run_java += ['TOOL'] + depends
diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py
index 8970837f0f8..a490589b4c2 100644
--- a/build/plugins/ytest.py
+++ b/build/plugins/ytest.py
@@ -1,9 +1,9 @@
import os
import re
import sys
-import json
+import json
import copy
-import base64
+import base64
import shlex
import _common
import lib._metric_resolvers as mr
@@ -348,7 +348,7 @@ def count_entries(x):
def get_values_list(unit, key):
- res = map(str.strip, (unit.get(key) or '').replace('$' + key, '').strip().split())
+ res = map(str.strip, (unit.get(key) or '').replace('$' + key, '').strip().split())
return [r for r in res if r and r not in ['""', "''"]]
@@ -416,7 +416,7 @@ def get_project_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}
- flat_args, spec_args = _common.sort_by_keywords(keywords, args)
+ flat_args, spec_args = _common.sort_by_keywords(keywords, args)
test_data = sorted(_common.filter_out_by_keyword(spec_args.get('DATA', []) + get_norm_paths(unit, 'TEST_DATA_VALUE'), 'AUTOUPDATED'))
@@ -547,7 +547,7 @@ def onadd_check(unit, *args):
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,
+ 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]
test_dir = get_norm_unit_path(unit)
@@ -770,40 +770,40 @@ def add_test_to_dart(unit, test_type, binary_path=None, runner_bin=None):
_dump_test(unit, test_type, test_files, timeout, get_norm_unit_path(unit), custom_deps, test_data, python_paths, split_factor, fork_mode, test_size, tags, requirements, binary_path, test_cwd=test_cwd, runner_bin=runner_bin, yt_spec=yt_spec, data_files=data_files)
-def extract_java_system_properties(unit, args):
- if len(args) % 2:
+def extract_java_system_properties(unit, args):
+ if len(args) % 2:
return [], 'Wrong use of SYSTEM_PROPERTIES in {}: odd number of arguments'.format(unit.path())
-
+
props = []
- for x, y in zip(args[::2], args[1::2]):
- if x == 'FILE':
- if y.startswith('${BINDIR}') or y.startswith('${ARCADIA_BUILD_ROOT}') or y.startswith('/'):
+ for x, y in zip(args[::2], args[1::2]):
+ if x == 'FILE':
+ if y.startswith('${BINDIR}') or y.startswith('${ARCADIA_BUILD_ROOT}') or y.startswith('/'):
return [], 'Wrong use of SYSTEM_PROPERTIES in {}: absolute/build file path {}'.format(unit.path(), y)
-
- y = _common.rootrel_arc_src(y, unit)
- if not os.path.exists(unit.resolve('$S/' + y)):
+
+ y = _common.rootrel_arc_src(y, unit)
+ if not os.path.exists(unit.resolve('$S/' + y)):
return [], 'Wrong use of SYSTEM_PROPERTIES in {}: can\'t resolve {}'.format(unit.path(), y)
-
- y = '${ARCADIA_ROOT}/' + y
- props.append({'type': 'file', 'path': y})
- else:
- props.append({'type': 'inline', 'key': x, 'value': y})
-
+
+ y = '${ARCADIA_ROOT}/' + y
+ props.append({'type': 'file', 'path': y})
+ else:
+ props.append({'type': 'inline', 'key': x, 'value': y})
+
return props, None
-
-
-def onjava_test(unit, *args):
+
+
+def onjava_test(unit, *args):
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':
- if not unit.get('UNITTEST_DIR'):
+ assert unit.get('MODULE_TYPE') is not None
+
+ if unit.get('MODULE_TYPE') == 'JTEST_FOR':
+ if not unit.get('UNITTEST_DIR'):
ymake.report_configure_error('skip JTEST_FOR in {}: no args provided'.format(unit.path()))
return
-
+
java_cp_arg_type = unit.get('JAVA_CLASSPATH_CMD_TYPE_VALUE') or 'MANIFEST'
if java_cp_arg_type not in ('MANIFEST', 'COMMAND_FILE', 'LIST'):
ymake.report_configure_error('{}: TEST_JAVA_CLASSPATH_CMD_TYPE({}) are invalid. Choose argument from MANIFEST, COMMAND_FILE or LIST)'.format(unit.path(), java_cp_arg_type))
@@ -811,11 +811,11 @@ def onjava_test(unit, *args):
unit_path = unit.path()
path = _common.strip_roots(unit_path)
-
+
test_data = get_norm_paths(unit, 'TEST_DATA_VALUE')
test_data.append('arcadia/build/scripts/run_junit.py')
test_data.append('arcadia/build/scripts/unpacking_jtest_runner.py')
-
+
data, data_files = get_canonical_test_resources(unit)
test_data += data
@@ -823,49 +823,49 @@ def onjava_test(unit, *args):
if error_mgs:
ymake.report_configure_error(error_mgs)
return
- for prop in props:
- if prop['type'] == 'file':
- test_data.append(prop['path'].replace('${ARCADIA_ROOT}', 'arcadia'))
-
- props = base64.b64encode(json.dumps(props, encoding='utf-8'))
-
- test_cwd = unit.get('TEST_CWD_VALUE') or '' # TODO: validate test_cwd value
-
+ for prop in props:
+ if prop['type'] == 'file':
+ test_data.append(prop['path'].replace('${ARCADIA_ROOT}', 'arcadia'))
+
+ props = base64.b64encode(json.dumps(props, encoding='utf-8'))
+
+ test_cwd = unit.get('TEST_CWD_VALUE') or '' # TODO: validate test_cwd value
+
if unit.get('MODULE_TYPE') == 'JUNIT5':
script_rel_path = 'junit5.test'
else:
script_rel_path = 'junit.test'
ymake_java_test = unit.get('YMAKE_JAVA_TEST') == 'yes'
- test_record = {
- 'SOURCE-FOLDER-PATH': path,
- 'TEST-NAME': '-'.join([os.path.basename(os.path.dirname(path)), os.path.basename(path)]),
+ test_record = {
+ 'SOURCE-FOLDER-PATH': path,
+ 'TEST-NAME': '-'.join([os.path.basename(os.path.dirname(path)), os.path.basename(path)]),
'SCRIPT-REL-PATH': script_rel_path,
'TEST-TIMEOUT': unit.get('TEST_TIMEOUT') or '',
'TESTED-PROJECT-NAME': path,
'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'))),
- 'FORK-MODE': unit.get('TEST_FORK_MODE') or '',
- 'SPLIT-FACTOR': unit.get('TEST_SPLIT_FACTOR') or '',
- 'CUSTOM-DEPENDENCIES': ' '.join(get_values_list(unit, 'TEST_DEPENDS_VALUE')),
+ 'FORK-MODE': unit.get('TEST_FORK_MODE') or '',
+ 'SPLIT-FACTOR': unit.get('TEST_SPLIT_FACTOR') or '',
+ 'CUSTOM-DEPENDENCIES': ' '.join(get_values_list(unit, 'TEST_DEPENDS_VALUE')),
'TAG': serialize_list(_get_test_tags(unit)),
- 'SIZE': unit.get('TEST_SIZE_NAME') or '',
+ 'SIZE': unit.get('TEST_SIZE_NAME') or '',
'REQUIREMENTS': serialize_list(get_values_list(unit, 'TEST_REQUIREMENTS_VALUE')),
'TEST-RECIPES': prepare_recipes(unit.get("TEST_RECIPES_VALUE")),
-
- # JTEST/JTEST_FOR only
- 'MODULE_TYPE': unit.get('MODULE_TYPE'),
- 'UNITTEST_DIR': unit.get('UNITTEST_DIR') or '',
- 'JVM_ARGS': serialize_list(get_values_list(unit, 'JVM_ARGS_VALUE')),
- 'SYSTEM_PROPERTIES': props,
- 'TEST-CWD': test_cwd,
+
+ # JTEST/JTEST_FOR only
+ 'MODULE_TYPE': unit.get('MODULE_TYPE'),
+ 'UNITTEST_DIR': unit.get('UNITTEST_DIR') or '',
+ 'JVM_ARGS': serialize_list(get_values_list(unit, 'JVM_ARGS_VALUE')),
+ 'SYSTEM_PROPERTIES': props,
+ 'TEST-CWD': test_cwd,
'SKIP_TEST': unit.get('SKIP_TEST_VALUE') or '',
'JAVA_CLASSPATH_CMD_TYPE': java_cp_arg_type,
'NO_JBUILD': 'yes' if ymake_java_test else 'no',
'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT'),
'JDK_FOR_TESTS': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') + '_FOR_TESTS',
- }
+ }
test_classpath_origins = unit.get('TEST_CLASSPATH_VALUE')
if test_classpath_origins:
test_record['TEST_CLASSPATH_ORIGINS'] = test_classpath_origins
@@ -877,12 +877,12 @@ def onjava_test(unit, *args):
test_record['TEST_JAR'] = '${UNITTEST_MOD}'
else:
test_record['TEST_JAR'] = '{}/{}.jar'.format(unit.get('MODDIR'), unit.get('REALPRJNAME'))
-
+
data = dump_test(unit, test_record)
if data:
unit.set_property(['DART_DATA', data])
-
-
+
+
def onjava_test_deps(unit, *args):
if unit.get("TIDY") == "yes":
# graph changed for clang_tidy tests