diff options
author | alevitskii <alevitskii@yandex-team.com> | 2025-03-03 20:16:31 +0300 |
---|---|---|
committer | alevitskii <alevitskii@yandex-team.com> | 2025-03-03 21:37:52 +0300 |
commit | 44d24c35433de6b811c408108e71dbd4fd74663d (patch) | |
tree | 506b69f9eff9f5fb5a390d3dac32262177666d23 | |
parent | aa84aca47ae5ac31b5c9c8880a662618f29658af (diff) | |
download | ydb-44d24c35433de6b811c408108e71dbd4fd74663d.tar.gz |
Send porto_layers requirements to SB task
Send porto_layers requirements to SB task
commit_hash:13f2b498c203c43770c7c4dcfb8cbea59f12569b
-rw-r--r-- | build/plugins/_requirements.py | 9 | ||||
-rw-r--r-- | build/plugins/lib/test_const/__init__.py | 1 | ||||
-rw-r--r-- | build/plugins/ytest.py | 7 |
3 files changed, 14 insertions, 3 deletions
diff --git a/build/plugins/_requirements.py b/build/plugins/_requirements.py index 40c50f87915..c358914e0e5 100644 --- a/build/plugins/_requirements.py +++ b/build/plugins/_requirements.py @@ -4,6 +4,7 @@ import lib._metric_resolvers as mr CANON_SB_VAULT_REGEX = re.compile(r"\w+=(value|file):[-\w]+:\w+") CANON_YAV_REGEX = re.compile(r"\w+=(value|file):sec-[a-z0-9]+:\w+") +PORTO_LAYERS_REGEX = re.compile(r"^\d+(,\d+)*$") VALID_DNS_REQUIREMENTS = ("default", "local", "dns64") VALID_NETWORK_REQUIREMENTS = ("full", "restricted") @@ -87,6 +88,11 @@ def validate_yav_vault(name, value): return "yav value '{}' should follow pattern <ENV_NAME>=<value|file>:<sec-id>:<key>".format(value) +def validate_porto_layers(name, value): + if not PORTO_LAYERS_REGEX.match(value): + return "porto layers '{}' should follow pattern porto_layers=<layerId1>[,<layerIdN>]*".format(value) + + def validate_numerical_requirement(name, value): if mr.resolve_value(value) is None: return "Cannot convert [[imp]]{}[[rst]] to the proper [[imp]]{}[[rst]] requirement value".format(value, name) @@ -133,6 +139,7 @@ def validate_requirement( ): req_checks = { 'container': validate_numerical_requirement, + 'porto_layers': validate_porto_layers, 'cpu': lambda n, v: validate_force_sandbox_requirement( n, v, test_size, is_force_sandbox, in_autocheck, is_fuzzing, is_kvm, is_ytexec_run, check_cpu ), @@ -166,7 +173,7 @@ def validate_requirement( req_name, ", ".join(sorted(req_checks)) ) - if req_name in ('container', 'disk') and not is_force_sandbox: + if req_name in ('container', 'disk', 'porto_layers') and not is_force_sandbox: return "Only [[imp]]LARGE[[rst]] tests without [[imp]]ya:force_distbuild[[rst]] tag can have [[imp]]{}[[rst]] requirement".format( req_name ) diff --git a/build/plugins/lib/test_const/__init__.py b/build/plugins/lib/test_const/__init__.py index 2fda7cb97aa..1319ec0eadb 100644 --- a/build/plugins/lib/test_const/__init__.py +++ b/build/plugins/lib/test_const/__init__.py @@ -231,6 +231,7 @@ class TestRequirements(Enum): Dns = 'dns' Kvm = 'kvm' Network = 'network' + PortoLayers = 'porto_layers' Ram = 'ram' RamDisk = 'ram_disk' SbVault = 'sb_vault' diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py index 4ae288e0622..937c049aff7 100644 --- a/build/plugins/ytest.py +++ b/build/plugins/ytest.py @@ -268,8 +268,11 @@ def validate_test(unit, kw): if in_autocheck and size == consts.TestSize.Large: errors.append("LARGE test must have ya:fat tag") - if consts.YaTestTags.Privileged in tags and 'container' not in requirements: - errors.append("Only tests with 'container' requirement can have 'ya:privileged' tag") + if 'container' in requirements and 'porto_layers' in requirements: + errors.append("Only one of 'container', 'porto_layers' can be set, not both") + + if consts.YaTestTags.Privileged in tags and 'container' not in requirements and 'porto_layers' not in requirements: + errors.append("Only tests with 'container' or 'porto_layers' requirement can have 'ya:privileged' tag") if size not in size_timeout: errors.append( |