Skip to content

Commit f43d13f

Browse files
committed
Add macro PARALLEL_TESTS_WITHIN_NODE instead of PARALLEL_TESTS_ON_YT_WITHIN_NODE
commit_hash:bd1fe3dc21384114babda849102561d4f08dd944
1 parent 2539a61 commit f43d13f

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

build/plugins/_dart_fields.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,24 +431,39 @@ def value(cls, unit, flat_args, spec_args):
431431

432432

433433
class ParallelTestsInSingleNode:
434-
KEY = 'PARALLEL-TESTS-WITHIN-NODE-ON-YT'
434+
KEY = 'PARALLEL-TESTS-WITHIN-NODE-WORKERS'
435435

436436
@classmethod
437437
def value(cls, unit, flat_args, spec_args):
438-
value = unit.get('PARALLEL_TESTS_ON_YT_WITHIN_NODE_WORKERS')
438+
return cls.get_value(unit, "PARALLEL_TESTS_WITHIN_NODE_WORKERS")
439+
440+
@classmethod
441+
def get_value(cls, unit, key):
442+
value = unit.get(key)
439443

440444
if value:
441445
value = value.lower()
442-
if value != 'all' and not (value.isnumeric() and int(value) > 0):
446+
if value == 'all':
447+
value = 'auto'
448+
if value != 'auto' and not (value.isnumeric() and int(value) > 0):
443449
raise DartValueError(
444-
'Incorrect value of PARALLEL_TESTS_ON_YT_WITHIN_NODE. Expected either "all" or a positive integer value, got: {}'.format(
450+
'Incorrect value of PARALLEL_TESTS_WITHIN_NODE. Expected either "auto" or a positive integer value, got: {}'.format(
445451
value,
446452
),
447453
)
448454

449455
return value
450456

451457

458+
# TODO(bulatman) Temporary class for backward compatibility.
459+
class ParallelTestsInSingleNodeOnYt:
460+
KEY = 'PARALLEL-TESTS-WITHIN-NODE-ON-YT'
461+
462+
@classmethod
463+
def value(cls, unit, flat_args, spec_args):
464+
return ParallelTestsInSingleNode.get_value(unit, "PARALLEL_TESTS_ON_YT_WITHIN_NODE_WORKERS")
465+
466+
452467
class ForkMode:
453468
KEY = 'FORK-MODE'
454469

build/plugins/ytest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
YTEST_FIELDS_EXTRA = (
5959
df.Blob.value,
6060
df.ParallelTestsInSingleNode.value,
61+
df.ParallelTestsInSingleNodeOnYt.value,
6162
df.ForkMode.from_macro_and_unit,
6263
df.Size.from_macro_args_and_unit,
6364
df.Tag.from_macro_args_and_unit,

build/ymake.core.conf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2848,15 +2848,23 @@ macro VALIDATE_DATA_RESTART(Ext) {
28482848
}
28492849

28502850
PARALLEL_TESTS_ON_YT_WITHIN_NODE_WORKERS=
2851+
PARALLEL_TESTS_WITHIN_NODE_WORKERS=
28512852
# tag:test
2852-
### @usage: PARALLEL_TESTS_ON_YT_WITHIN_NODE(CPUS)
2853+
### @usage: PARALLEL_TESTS_ON_YT_WITHIN_NODE(COUNT)
28532854
###
28542855
### Execute tests in parallel within one node.
2856+
###
2857+
### Supported for execution tests on yt/sandbox and local run. Ignored for unsupported test types and environments.
28552858
### May cause some tests to break due to races or other circumstances.
2856-
### Allowed values of CPUS: 'all' to run tests in all available CPUs, or integer amount of workers used.
2859+
###
2860+
### Allowed values of COUNT:
2861+
### 'auto' to run tests in all available CPUs according to requirements, or integer amount of workers used.
2862+
###
28572863
### EXPERIMENTAL! DO NOT USE IF YOU ARE NOT SURE.
2858-
macro PARALLEL_TESTS_ON_YT_WITHIN_NODE(CPUS) {
2859-
SET(PARALLEL_TESTS_ON_YT_WITHIN_NODE_WORKERS $CPUS)
2864+
macro PARALLEL_TESTS_ON_YT_WITHIN_NODE(COUNT) {
2865+
# TODO(bulatman) For backward compatibility, remove after release of ya-bin.
2866+
SET(PARALLEL_TESTS_ON_YT_WITHIN_NODE_WORKERS $COUNT)
2867+
SET(PARALLEL_TESTS_WITHIN_NODE_WORKERS $COUNT)
28602868
}
28612869

28622870
# tag:test

0 commit comments

Comments
 (0)