Browse Source

Add lost data dependencies

tekireeva 1 year ago
parent
commit
7a72abba41
2 changed files with 8 additions and 4 deletions
  1. 0 2
      build/plugins/java.py
  2. 8 2
      build/plugins/ytest.py

+ 0 - 2
build/plugins/java.py

@@ -88,8 +88,6 @@ def ongenerate_script(unit, *args):
 
 def onjava_module(unit, *args):
     args_delim = unit.get('ARGS_DELIM')
-    if unit.get('ADD_SRCDIR_TO_TEST_DATA') == "yes":
-        unit.ondata_files(common.strip_roots(unit.path()))
 
     if unit.get('YA_IDE_IDEA') != 'yes':
         return

+ 8 - 2
build/plugins/ytest.py

@@ -454,6 +454,9 @@ def onadd_ytest(unit, *args):
     if flat_args[1] == "fuzz.test":
         unit.ondata("arcadia/fuzzing/{}/corpus.json".format(_common.get_norm_unit_path(unit)))
 
+    if not flat_args[1] in ("unittest.py", "gunittest", "g_benchmark"):
+        unit.ondata_files(get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE'))
+
     test_data = sorted(
         _common.filter_out_by_keyword(
             spec_args.get('DATA', []) + get_norm_paths(unit, 'TEST_DATA_VALUE'), 'AUTOUPDATED'
@@ -832,6 +835,8 @@ def add_test_to_dart(unit, test_type, binary_path=None, runner_bin=None):
     split_factor = unit.get('TEST_SPLIT_FACTOR') or ''
     test_size = unit.get('TEST_SIZE_NAME') or ''
     test_cwd = unit.get('TEST_CWD_VALUE') or ''
+    yt_spec = get_values_list(unit, 'TEST_YT_SPEC_VALUE')
+    unit.ondata_files(yt_spec)
 
     unit_path = unit.path()
     test_files = get_values_list(unit, 'TEST_SRCS_VALUE')
@@ -841,7 +846,6 @@ def add_test_to_dart(unit, test_type, binary_path=None, runner_bin=None):
     data, data_files = get_canonical_test_resources(unit)
     test_data += data
     python_paths = get_values_list(unit, 'TEST_PYTHON_PATH_VALUE')
-    yt_spec = get_values_list(unit, 'TEST_YT_SPEC_VALUE')
     if not binary_path:
         binary_path = os.path.join(unit_path, unit.filename())
     _dump_test(
@@ -913,6 +917,8 @@ def onjava_test(unit, *args):
     path = _common.strip_roots(unit_path)
     if unit.get('ADD_SRCDIR_TO_TEST_DATA') == "yes":
         unit.ondata_files(_common.get_norm_unit_path(unit))
+    yt_spec_values = get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE')
+    unit.ondata_files(yt_spec_values)
 
     test_data = get_norm_paths(unit, 'TEST_DATA_VALUE')
     test_data.append('arcadia/build/scripts/run_junit.py')
@@ -965,7 +971,7 @@ def onjava_test(unit, *args):
         'JAVA_CLASSPATH_CMD_TYPE': java_cp_arg_type,
         'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or unit.get('JDK_REAL_VERSION') or '_DEFAULT'),
         'JDK_FOR_TESTS': 'JDK' + (unit.get('JDK_VERSION') or unit.get('JDK_REAL_VERSION') or '_DEFAULT') + '_FOR_TESTS',
-        'YT-SPEC': serialize_list(get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE')),
+        'YT-SPEC': serialize_list(yt_spec_values),
     }
     test_classpath_origins = unit.get('TEST_CLASSPATH_VALUE')
     if test_classpath_origins: