diff options
| author | YDBot <[email protected]> | 2026-06-23 10:16:41 +0000 |
|---|---|---|
| committer | YDBot <[email protected]> | 2026-06-23 10:16:41 +0000 |
| commit | a65b853300a3dfe2363face9ed276acc507242ea (patch) | |
| tree | bbf27cf590d46fb15e541a599433396128205e9e | |
| parent | 9dcbae1d3cec39fbd264f036c0eac0e07bfbeee5 (diff) | |
| parent | 11a82f2b8f9f92cf178124b395cfb67df2011582 (diff) | |
Merge pull request #44261 from ydb-platform/merge-rightlib-260623-0632
| -rw-r--r-- | build/conf/go.conf | 24 | ||||
| -rw-r--r-- | build/conf/settings.conf | 2 | ||||
| -rw-r--r-- | build/mapping.conf.json | 2 | ||||
| -rw-r--r-- | build/platform/test_tool/host.ya.make.inc | 10 | ||||
| -rw-r--r-- | build/platform/test_tool/host_os.ya.make.inc | 10 | ||||
| -rw-r--r-- | build/plugins/gobuild.py | 31 | ||||
| -rw-r--r-- | build/scripts/go_tool.py | 73 | ||||
| -rwxr-xr-x | ya | 20 |
8 files changed, 32 insertions, 140 deletions
diff --git a/build/conf/go.conf b/build/conf/go.conf index fbf56067d7e..6110bb0ced1 100644 --- a/build/conf/go.conf +++ b/build/conf/go.conf @@ -254,20 +254,6 @@ macro _GO_GEN_COVER(GO_PACKAGE, GO_FILES...) { .CMD=$_GO_COVER_CMD } -_GO_GEN_COVER_CMD=${hide:_GO_FAKEID} ${cwd;rootdir;input:GO_FILE} \ - $GO_TOOLS_ROOT/pkg/tool/$_GO_TC_PATH/cover \ - -mode set \ - -var $VAR_ID \ - -o ${output;suf=${_GO_COVER_EXT};noext:GO_COVER_OUTPUT} \ - ${rootrel;input:GO_FILE} \ - ${hide;kv:"p go"} ${hide;kv:"pc light-blue"} - -# tag:go-specific -# tag:deprecated -macro _GO_GEN_COVER_GO(GO_FILE, GO_COVER_OUTPUT, VAR_ID) { - .CMD=$_GO_GEN_COVER_CMD -} - # tag:go-specific macro _GO_COMPILE_SYMABIS(FLAGS[], ASM_FILES...) { .CMD=${hide:_CGO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/$_GO_TC_PATH/asm $_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__ ${pre=-I :_C__INCLUDE} -I $GO_TOOLS_ROOT/pkg/include -D GOOS_${GO_TARG_OS} -D GOARCH_${GO_TARG_ARCH} $FLAGS $GO_ASM_FLAGS_VALUE -gensymabis -o ${output:"gen.symabis"} ${input:ASM_FILES} ${hide;kv:"p go"} ${hide;kv:"pc light-blue"} ${hide;kv:"show_out"} @@ -335,7 +321,6 @@ _GO_LINK_TEST_IMPL_CMD=${hide:_GO_FAKEID} $GO_TOOL \ ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROGRAM|GO_PROTO|GO_PROTO_FROM_SCHEMA|GO_FBS|GO_DIAG|RESOURCE_LIB:PEERS} \ ++test_srcs ${input:GO_TEST_FILES} \ ++xtest_srcs ${input:GO_XTEST_FILES} \ - $IF(${not;empty:GO_COVER_INFO_VALUE} THEN ++cover_info ${GO_COVER_INFO_VALUE}) \ $IF(${not;empty:GO_COVER_MODE} THEN ++cover-mode ${GO_COVER_MODE} ++cover-cfg ${_GO_COVER_CFG} ++cover-covervars ${_GO_COVER_COVERVARS}) \ ++skip-tests $_GO_SKIP_TEST_VALUE \ --ya-end-command-file \ @@ -1148,7 +1133,6 @@ module GO_TEST: GO_PROGRAM { .TRANSITION=nopic ENABLE(GO_TEST_MODULE) DISABLE(_NEED_SBOM_INFO) - SET(GO_COVER_INFO_VALUE) SET(GO_COVER_MODE) # We have to add uncoditionaly PEERDIR to ${GOSTD}/os here thouth it is really @@ -1157,11 +1141,9 @@ module GO_TEST: GO_PROGRAM { PEERDIR(${GOSTD}/testing/internal/testdeps) PEERDIR(${GOSTD}/testing) - when ($GO_COVERAGE_PER_PKG) { - PEERDIR+=${GOSTD}/internal/coverage/cfile - # runtime/coverage required for make coverage for Go code with 'package main' - PEERDIR+=${GOSTD}/runtime/coverage - } + PEERDIR+=${GOSTD}/internal/coverage/cfile + # runtime/coverage required for make coverage for Go code with 'package main' + PEERDIR+=${GOSTD}/runtime/coverage PEERDIR(library/go/test/yatest) diff --git a/build/conf/settings.conf b/build/conf/settings.conf index 4a0a0c38be3..63f224e3574 100644 --- a/build/conf/settings.conf +++ b/build/conf/settings.conf @@ -12,8 +12,6 @@ PIC_NO_PIE=no FAIL_PY2=no MAIN_OUTPUT_AS_EXTRA=yes FILL_MODULE2NODES=yes -# Enabling support Go 1.25 coverage per package -GO_COVERAGE_PER_PKG=yes CONSISTENT_DEBUG=yes CONSISTENT_BUILD=yes diff --git a/build/mapping.conf.json b/build/mapping.conf.json index 219fe3dd8c9..ac741a31708 100644 --- a/build/mapping.conf.json +++ b/build/mapping.conf.json @@ -606,6 +606,7 @@ "12302016680": "{registry_endpoint}/12302016680", "12396918481": "{registry_endpoint}/12396918481", "12432841924": "{registry_endpoint}/12432841924", + "12520564176": "{registry_endpoint}/12520564176", "5486713852": "{registry_endpoint}/5486713852", "5514352253": "{registry_endpoint}/5514352253", "5523579199": "{registry_endpoint}/5523579199", @@ -2971,6 +2972,7 @@ "12302016680": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", "12396918481": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", "12432841924": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", + "12520564176": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", "5486713852": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", "5514352253": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", "5523579199": "devtools/ya/test/programs/test_tool/bin/test_tool for linux", diff --git a/build/platform/test_tool/host.ya.make.inc b/build/platform/test_tool/host.ya.make.inc index 809965a1b8a..c36645077f8 100644 --- a/build/platform/test_tool/host.ya.make.inc +++ b/build/platform/test_tool/host.ya.make.inc @@ -1,12 +1,12 @@ IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432854591) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520589969) ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432853031) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520587843) ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432857601) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520592470) ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432851243) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520586737) ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432856005) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520591280) ENDIF() diff --git a/build/platform/test_tool/host_os.ya.make.inc b/build/platform/test_tool/host_os.ya.make.inc index e7f778137bd..f74bb70c4ba 100644 --- a/build/platform/test_tool/host_os.ya.make.inc +++ b/build/platform/test_tool/host_os.ya.make.inc @@ -1,12 +1,12 @@ IF (HOST_OS_DARWIN AND HOST_ARCH_X86_64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432839490) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520562200) ELSEIF (HOST_OS_DARWIN AND HOST_ARCH_ARM64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432838177) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520561173) ELSEIF (HOST_OS_LINUX AND HOST_ARCH_X86_64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432841924) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520564176) ELSEIF (HOST_OS_LINUX AND HOST_ARCH_AARCH64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432836576) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520559796) ELSEIF (HOST_OS_WINDOWS AND HOST_ARCH_X86_64) - DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12432840738) + DECLARE_EXTERNAL_RESOURCE(TEST_TOOL_HOST sbr:12520563125) ENDIF() diff --git a/build/plugins/gobuild.py b/build/plugins/gobuild.py index 44037d09bdd..64c7ec65f4a 100644 --- a/build/plugins/gobuild.py +++ b/build/plugins/gobuild.py @@ -1,4 +1,3 @@ -import base64 import itertools from hashlib import md5 import os @@ -207,29 +206,13 @@ def _GO_PROCESS_SRCS(unit: ymake.Unit): # Go coverage instrumentation (NOTE! go_files list is modified here) if is_test_module and unit.enabled('GO_TEST_COVER'): - if unit.enabled('GO_COVERAGE_PER_PKG'): - go_giles = [] - for go_file in go_files: - if go_file.endswith('_test.go'): - continue - go_giles.append(unit.resolve_arc_path(go_file)) - unit.set(['GO_COVER_MODE', 'set']) # Enable Go coverage with mode="set" - unit.on_go_gen_cover([go_package_name(unit), *go_files]) - else: # deprecated - cover_info = [] - - for f in go_files: - if f.endswith('_test.go'): - continue - cover_var = 'GoCover' + base64.b32encode(f.encode('utf-8')).decode('utf-8').rstrip('=') - cover_file = unit.resolve_arc_path(f) - cover_file_output = '{}/{}'.format(unit_path, os.path.basename(f)) - unit.on_go_gen_cover_go([cover_file, cover_file_output, cover_var]) - if cover_file.startswith('$S/'): - cover_file = arc_project_prefix + cover_file[3:] - cover_info.append('{}:{}'.format(cover_var, cover_file)) - - unit.set(['GO_COVER_INFO_VALUE', ' '.join(cover_info)]) + go_giles = [] + for go_file in go_files: + if go_file.endswith('_test.go'): + continue + go_giles.append(unit.resolve_arc_path(go_file)) + unit.set(['GO_COVER_MODE', 'set']) # Enable Go coverage with mode="set" + unit.on_go_gen_cover([go_package_name(unit), *go_files]) # go_files should be empty now since the initial list shouldn't contain # any non-go or go test file. The value of go_files list will be used later diff --git a/build/scripts/go_tool.py b/build/scripts/go_tool.py index 4a65018ef08..e0324799cec 100644 --- a/build/scripts/go_tool.py +++ b/build/scripts/go_tool.py @@ -590,56 +590,6 @@ def do_link_exe(args): call(cmd, args.build_root) -def gen_cover_info(args, test_module: str): - lines = [] - lines.extend( - [ - """ -var ( - coverCounters = make(map[string][]uint32) - coverBlocks = make(map[string][]testing.CoverBlock) -) - """, - 'func init() {', - ] - ) - for var, file in (x.split(':') for x in args.cover_info): - lines.append( - ' coverRegisterFile("{file}", {test_module}.{var}.Count[:], {test_module}.{var}.Pos[:], {test_module}.{var}.NumStmt[:])'.format( - file=file, test_module=test_module, var=var - ) - ) - lines.extend( - [ - '}', - """ -func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts []uint16) { - if 3*len(counter) != len(pos) || len(counter) != len(numStmts) { - panic("coverage: mismatched sizes") - } - if coverCounters[fileName] != nil { - // Already registered. - return - } - coverCounters[fileName] = counter - block := make([]testing.CoverBlock, len(counter)) - for i := range counter { - block[i] = testing.CoverBlock{ - Line0: pos[3*i+0], - Col0: uint16(pos[3*i+2]), - Line1: pos[3*i+1], - Col1: uint16(pos[3*i+2]>>16), - Stmts: numStmts[i], - } - } - coverBlocks[fileName] = block -} - """, - ] - ) - return lines - - def filter_out_skip_tests(tests, skip_tests): skip_set = set() star_skip_set = set() @@ -677,7 +627,6 @@ def gen_test_main(args, test_lib_args, xtest_lib_args): assert args and (test_lib_args or xtest_lib_args) test_miner = args.test_miner cover_mode = args.cover_mode # Go coverage per Go-package - is_cover = args.cover_info and len(args.cover_info) > 0 # deprecated # Prepare GOPATH # $BINDIR @@ -759,12 +708,6 @@ def gen_test_main(args, test_lib_args, xtest_lib_args): + ([' "os"'] if not test_main_package else []) # else unused import os happened # Skip "reflect", because os.Exit called inside TestMain and reflect functions not used + ([' "internal/coverage/cfile"'] if cover_mode else []) - + ([' _cover_test "{}"'.format(test_import_path)] if is_cover and test_import_path else []) # deprecated - + ( - [' _cover_xtest "{}"'.format(xtest_import_path)] - if is_cover and (xtest_import_path and not test_import_path) - else [] - ) # deprecated + [ ' "testing"', ' "testing/internal/testdeps"', @@ -792,17 +735,6 @@ def gen_test_main(args, test_lib_args, xtest_lib_args): lines.extend([f'var {var_name} = []testing.Internal{kind}{{'] + test_lines + xtest_lines + ['}', '']) lines.append('func init() {') - if is_cover: # deprecated - lines.extend( - [ - ' testing.RegisterCover(testing.Cover{', - ' Mode: "set",', - ' Counters: coverCounters,', - ' Blocks: coverBlocks,', - ' CoveredPackages: "",', - ' })', - ] - ) if cover_mode: lines.extend( [ @@ -816,10 +748,6 @@ def gen_test_main(args, test_lib_args, xtest_lib_args): ) lines.extend(['}', '']) - if is_cover: # deprecated - # old coverage supported or only _cover_test, or only _cover_xtest, never both - lines.extend(gen_cover_info(args, '_cover_test' if test_import_path else '_cover_xtest')) - lines.extend( [ 'func main() {', @@ -950,7 +878,6 @@ if __name__ == '__main__': parser.add_argument('++cgo-srcs', nargs='*') parser.add_argument('++test_srcs', nargs='*') parser.add_argument('++xtest_srcs', nargs='*') - parser.add_argument('++cover_info', nargs='*') parser.add_argument('++cover-mode', choices=['set', 'count', 'atomic']) parser.add_argument('++cover-cfg', help='coverage output config, if zero-size, really no coverage') parser.add_argument( @@ -39,33 +39,33 @@ REGISTRY_ENDPOINT = os.environ.get("YA_REGISTRY_ENDPOINT", "https://devtools-reg PLATFORM_MAP = { "data": { "win32": { - "md5": "89f00e81c725d95270b39cec5f13ff3f", + "md5": "25162a68a980d03b47d7f410c3239d1f", "urls": [ - f"{REGISTRY_ENDPOINT}/12432863295" + f"{REGISTRY_ENDPOINT}/12520644915" ] }, "darwin": { - "md5": "ca8bbb772f1edbcf15a81b7f9f5bfaad", + "md5": "0cf77c4c930f416f3a62013dd40d6673", "urls": [ - f"{REGISTRY_ENDPOINT}/12432862054" + f"{REGISTRY_ENDPOINT}/12520643371" ] }, "darwin-arm64": { - "md5": "1255988325083721c775dbe57a90f097", + "md5": "172832414ff77d4e838ff2eeaadb3f83", "urls": [ - f"{REGISTRY_ENDPOINT}/12432860850" + f"{REGISTRY_ENDPOINT}/12520642036" ] }, "linux-aarch64": { - "md5": "9d2c76542aacdac5f427df24af5d9570", + "md5": "81ffc4ad29b52771638cf9247dc3c200", "urls": [ - f"{REGISTRY_ENDPOINT}/12432859703" + f"{REGISTRY_ENDPOINT}/12520640353" ] }, "linux": { - "md5": "d757b5f6d250eba75958938189891fdf", + "md5": "b52ef0ceb71b7cccd9085c1f95fe0090", "urls": [ - f"{REGISTRY_ENDPOINT}/12432865375" + f"{REGISTRY_ENDPOINT}/12520647091" ] } } |
