From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 6495F6ECCC; Mon, 25 May 2026 12:15:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6495F6ECCC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1779700513; bh=L0+hgsZw/pHO7iYnFaimtPI7sHharGCND6JSZ8tEIRE=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=zONmSMvl/Zf0txJxLzoGkqv3ao4xfmt7noMWAltKU4Wtcykwcifl1R2zn8ybCsyVp 1fCo5lnSLmPy69mRs6Udu5YpZoqI9R+RlU4R7WXgm6E1QZLhFdF8hhwLoOTRtq/aQQ wIHqLn0oXG935shuvsJM/PSWl7TBaYybyaBSaUAw= Received: from send126.i.mail.ru (send126.i.mail.ru [89.221.237.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4BF956ECCC for ; Mon, 25 May 2026 12:15:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4BF956ECCC Received: by exim-smtp-8466d5ddfc-cpfjw with esmtpa (envelope-from ) id 1wRROx-00000000GNR-0Pvs; Mon, 25 May 2026 12:15:11 +0300 Date: Mon, 25 May 2026 12:14:33 +0300 To: Sergey Bronnikov Message-ID: References: <20260519123913.178775-1-skaplun@tarantool.org> <20260519123913.178775-2-skaplun@tarantool.org> <3703735e-192b-4e3f-8842-2cff7a61e725@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3703735e-192b-4e3f-8842-2cff7a61e725@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD98DC58EE55F2C5C374A7150980F231CEB4594521187ABD14F00894C459B0CD1B94D4651AFDFAA0D95479CDAE959BF6424BA322887A328CCD3682FAA9EF1C3025E5F9067195EC86057 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7492D3E4238663367EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FE9EFE935CD7C6AE8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B20A24C734C5C7D3D02E070BE324C7D3C4F294E8A156D87CCFF6B57BC7E64490618DEB871D839B73339E8FC8737B5C22498424CA1AAF98A6958941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE76A5FABD60623B554731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5FC62584AE015D9C55002B1117B3ED696B615DE88D3951A46B91D2EB2DEE3878C823CB91A9FED034534781492E4B8EEADF5E532225D4D775BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADB58128AB1E6D661A8E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659B81159D199F005A3F4465C4CFF0B7E62D73E23FD4CA4163663D9F1BA6C2ACA72F32002BDC6E610ABB8341EE9D5BE9A0AD1FDC04424A4AFA9419FD842664B92194E557F3362EFB6E3C7CEAA0681F5848F4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVax5M0mESuWm7vRpXScbIR4= X-DA7885C5: 2C07A573DC482072F255D290C0D534F96A8BC2B4D7D2EF27304F2523DEC07CA6C718533A40F688875B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393520AF17B8A65FDE2C6BFEBAC0757786901AB631714214C3395E7A17828CC9AB5E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 1/6] test: introduce tests for debugging extensions X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! See my answers below. On 20.05.26, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for the patch! Please see my comments. > > Sergey > > On 5/19/26 15:39, Sergey Kaplun wrote: > > From: Maxim Kokryashkin > > It looks like the patch was made by Maxim K. and you took it as is, but > it is not so. > > The latest version of this patch is here [1] and there several changes > introduced by you. > > I suppose these changes should be described and you should to somehow > > say that you changed the patch a little (for example using Git trailer > "Co-authored-by:"). Added Co-authored-by. | test: introduce tests for debugging extensions | | This patch adds tests for LuaJIT debugging extensions for lldb and gdb. | The tests are written in Python's unittest framework [1]. | | Most of the tests are failed for the lldb due to outdated extension | sources and overcomplicated hard-coded C structures fields | introspection. Hence, tests for LLDB are disabled since they are failing | anyway. | | The tarantool-debugger-tests target is introduced. This target is | included in the LuaJIT-check-all target but not in the LuaJIT-test | target to avoid it running for all LuaJIT builds by default in CI. | | [1]: https://docs.python.org/3/library/unittest.html | | Co-authored-by: Sergey Kaplun > > Otherwise, we are following bad practices, let's not be like those > people we usually joke about. > > The full diff is below: > [1]: > https://lists.tarantool.org/tarantool-patches/cover.1712182830.git.m.kokryashkin@tarantool.org/ > > > This patch adds tests for LuaJIT debugging extensions for lldb and gdb. > > The tests are written in Python's unittest framework [1]. > > > > Most of the tests are failed for the lldb due to outdated extension > > sources and overcomplicated hard-coded C structures fields > > introspection. Hence, tests for LLDB are disabled since they are failing > > anyway. > > > > The tarantool-debugger-tests target is introduced. This target is > > included in the LuaJIT-check-all target but not in the LuaJIT-test > > target to avoid it running for all LuaJIT builds by default in CI. > > I don't get why we cannot run debugger tests together with other tests. > > dbg extension must work with all LuaJIT configurations that we test in CI, > > so I suppose we should run these (dbg) tests with all other regression > tests. It complicates testing requirements (you need to install the corresponding packages) or tests will be skipped anyway. Also, it adds issues for GDB installation on macOS. This tests can't be run without debugging symbols (i.e. in Release builds and may be broken in RelWithDebInfo builds). Hence it effectively restricts tests to the mentioned in the last commit. All exotic builds are not related to the testing nature. Hence, I believe that tests for __language runtime__ should be separated from the tests of the debug extension for this runtime, since they are different entities. All runtime differences are unrelated to the testing of this extension (as all interesting cases for us are covered by the set of runs in the last patch). > For example, the proposed GHA workflows doesn't cover DUALNUM build, It is tested by arm64 build. > > сan I be sure that the extension will work with DUALNUM build? Seems no. > > > > > [1]:https://docs.python.org/3/library/unittest.html > > --- > > test/CMakeLists.txt | 7 + > > test/tarantool-debugger-tests/CMakeLists.txt | 93 ++++++ > > .../debug-extension-tests.py | 286 ++++++++++++++++++ > > 3 files changed, 386 insertions(+) > > create mode 100644 test/tarantool-debugger-tests/CMakeLists.txt > > create mode 100644 test/tarantool-debugger-tests/debug-extension-tests.py > > > > diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt > > index f48afa25..26b15892 100644 > > --- a/test/CMakeLists.txt > > +++ b/test/CMakeLists.txt > > @@ -175,6 +175,7 @@ add_subdirectory(LuaJIT-tests) > > add_subdirectory(PUC-Rio-Lua-5.1-tests) > > add_subdirectory(lua-Harness-tests) > > add_subdirectory(tarantool-c-tests) > > +add_subdirectory(tarantool-debugger-tests) > > add_subdirectory(tarantool-tests) > > > > # Each testsuite has its own CMake target, but combining these > > @@ -186,6 +187,9 @@ add_subdirectory(tarantool-tests) > > # command that runs all generated CMake tests. > > add_custom_target(${PROJECT_NAME}-test > > COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_FLAGS} > > + # Omit this target in LuaJIT-test since we don't want to set > > + # up and run debuggers for every build. > > + --label-exclude tarantool-debugger-tests > see the comment above See my answer above. > > DEPENDS tarantool-c-tests-deps > > tarantool-tests-deps > > lua-Harness-tests-deps > > @@ -195,5 +199,8 @@ add_custom_target(${PROJECT_NAME}-test > > > > add_custom_target(${PROJECT_NAME}-check-all > > DEPENDS ${PROJECT_NAME}-test > > + # Omit this target in LuaJIT-test since we don't want to > > + # set up and run debuggers for every build. > > + tarantool-debugger-tests > > ${PROJECT_NAME}-lint > > ) > > diff --git a/test/tarantool-debugger-tests/CMakeLists.txt b/test/tarantool-debugger-tests/CMakeLists.txt > > new file mode 100644 > > index 00000000..7fd0debc > > --- /dev/null > > +++ b/test/tarantool-debugger-tests/CMakeLists.txt > > @@ -0,0 +1,93 @@ > > +set(TEST_SUITE_NAME "tarantool-debugger-tests") > > + > > +# XXX: The call produces both test and target > > +# as a side effect. > > +add_test_suite_target(tarantool-debugger-tests > > + LABELS ${TEST_SUITE_NAME} > > + DEPENDS ${LUAJIT_TEST_BINARY} > > +) > > + > > +# Debug info is required for testing of extensions. > > +if(NOT (CMAKE_BUILD_TYPE MATCHES Debug)) > > + message(WARNING > > + "Not a DEBUG build, tarantool-debugger-tests is dummy" > > + ) > > it is not dummy, it doesn't exist at all: > > cmake -S . -B build -DCMAKE_BUILD_TYPE=Release > > cd build > > make tarantool-debugger-tests > make[3]: *** No rule to make target 'src/luajit', needed by > 'test/tarantool-debugger-tests/CMakeFiles/tarantool-debugger-tests-deps'. > Stop. Replaced elsewhere with "omitted". =================================================================== diff --git a/test/tarantool-debugger-tests/CMakeLists.txt b/test/tarantool-debugger-tests/CMakeLists.txt index 7fd0debc..a6684e72 100644 --- a/test/tarantool-debugger-tests/CMakeLists.txt +++ b/test/tarantool-debugger-tests/CMakeLists.txt @@ -10,7 +10,7 @@ add_test_suite_target(tarantool-debugger-tests # Debug info is required for testing of extensions. if(NOT (CMAKE_BUILD_TYPE MATCHES Debug)) message(WARNING - "Not a DEBUG build, tarantool-debugger-tests is dummy" + "Not a DEBUG build, tarantool-debugger-tests is omitted" ) return() endif() @@ -22,7 +22,7 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED ENV{CI}) message(WARNING "Interactive debugging is unavailable for macOS CI builds," - " tarantool-debugger-tests is dummy" + " tarantool-debugger-tests is omitted" ) return() endif() @@ -31,13 +31,17 @@ if(CMAKE_VERSION VERSION_LESS "3.12") # TODO:Can remove this after upgrading to CMake >= 3.12. find_package(PythonInterp) if(NOT PYTHONINTERP_FOUND) - message(WARNING "`python` is not found, tarantool-debugger-tests is dummy") + message(WARNING + "`python` is not found, tarantool-debugger-tests is omitted" + ) return() endif() else() find_package(Python COMPONENTS Interpreter) if(NOT PYTHON_FOUND) - message(WARNING "`python` is not found, tarantool-debugger-tests is dummy") + message(WARNING + "`python` is not found, tarantool-debugger-tests is omitted" + ) return() endif() set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}") =================================================================== > > > + return() > > +endif() > > + > > +# MacOS asks for permission to debug a process even when the > > +# machine is set into development mode. To solve the issue, > > +# it is required to add relevant users to the `_developer` user > > +# group in macOS. Disabled for now. > > +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED ENV{CI}) > > + message(WARNING > > + "Interactive debugging is unavailable for macOS CI builds," > > + " tarantool-debugger-tests is dummy" > > + ) > the same as above, it is not dummy > > + return() > > +endif() > > + > > +if(CMAKE_VERSION VERSION_LESS "3.12") > > + #TODO:Can remove this after upgrading to CMake >= 3.12. > s/TODO:/TODO/ Fixed: =================================================================== diff --git a/test/tarantool-debugger-tests/CMakeLists.txt b/test/tarantool-debugger-tests/CMakeLists.txt index f97e4b3c..39414db3 100644 --- a/test/tarantool-debugger-tests/CMakeLists.txt +++ b/test/tarantool-debugger-tests/CMakeLists.txt @@ -28,7 +28,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED ENV{CI}) endif() if(CMAKE_VERSION VERSION_LESS "3.12") - # TODO:Can remove this after upgrading to CMake >= 3.12. + # TODO: Can remove this after upgrading to CMake >= 3.12. find_package(PythonInterp) if(NOT PYTHONINTERP_FOUND) message(WARNING =================================================================== > > + find_package(PythonInterp) > > + if(NOT PYTHONINTERP_FOUND) > > + message(WARNING "`python` is not found, tarantool-debugger-tests is dummy") Fixed backtick here and below. =================================================================== diff --git a/test/tarantool-debugger-tests/CMakeLists.txt b/test/tarantool-debugger-tests/CMakeLists.txt index a6684e72..f97e4b3c 100644 --- a/test/tarantool-debugger-tests/CMakeLists.txt +++ b/test/tarantool-debugger-tests/CMakeLists.txt @@ -32,7 +32,7 @@ if(CMAKE_VERSION VERSION_LESS "3.12") find_package(PythonInterp) if(NOT PYTHONINTERP_FOUND) message(WARNING - "`python` is not found, tarantool-debugger-tests is omitted" + "`python' is not found, tarantool-debugger-tests is omitted" ) return() endif() @@ -40,7 +40,7 @@ else() find_package(Python COMPONENTS Interpreter) if(NOT PYTHON_FOUND) message(WARNING - "`python` is not found, tarantool-debugger-tests is omitted" + "`python' is not found, tarantool-debugger-tests is omitted" ) return() endif() =================================================================== > it is not dummy > > + return() > > + endif() > > +else() > > + find_package(Python COMPONENTS Interpreter) > > + if(NOT PYTHON_FOUND) > > + message(WARNING "`python` is not found, tarantool-debugger-tests is dummy") > it is not dummy > > + return() > > + endif() > > + set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}") > > +endif() > > + > > +set(DEBUGGER_TEST_ENV > > + "LUAJIT_TEST_BINARY=${LUAJIT_TEST_BINARY}" > > + # Suppresses __pycache__ generation. > > + "PYTHONDONTWRITEBYTECODE=1" > > + "DEBUGGER_EXTENSION_PATH=${PROJECT_SOURCE_DIR}/src" > > +) > > + > > +set(TEST_SCRIPT_PATH > > + ${CMAKE_CURRENT_SOURCE_DIR}/debug-extension-tests.py > > +) > > + > > +find_program(GDB gdb) > > +if(GDB) > > + set(test_title "test/${TEST_SUITE_NAME}/gdb") > > + set(GDB_TEST_ENV ${DEBUGGER_TEST_ENV} "DEBUGGER_COMMAND=${GDB}") > > + add_test(NAME "${test_title}" > > + COMMAND ${PYTHON_EXECUTABLE} ${TEST_SCRIPT_PATH} > > + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > > + ) > > + set_tests_properties("${test_title}" PROPERTIES > > + ENVIRONMENT "${GDB_TEST_ENV}" > > + LABELS ${TEST_SUITE_NAME} > > + DEPENDS tarantool-debugger-tests-deps > > + ) > > +else() > > + message(WARNING > > + "`gdb' is not found, so tarantool-debugger-tests/gdb is omitted" > > + ) > > +endif() > > + > > +find_program(LLDB lldb) > > +if(LLDB) > > + set(test_title "test/${TEST_SUITE_NAME}/lldb") > > + set(LLDB_TEST_ENV ${DEBUGGER_TEST_ENV} "DEBUGGER_COMMAND=${LLDB}") > > + add_test(NAME "${test_title}" > > + COMMAND ${PYTHON_EXECUTABLE} ${TEST_SCRIPT_PATH} > > + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > > + ) > > + set_tests_properties("${test_title}" PROPERTIES > > + ENVIRONMENT "${LLDB_TEST_ENV}" > > + LABELS ${TEST_SUITE_NAME} > > + DEPENDS tarantool-debugger-tests-deps > > + ) > > +else() > > + message(WARNING > > + "`lldb' is not found, so tarantool-debugger-tests/lldb is omitted" > > + ) > > +endif() > Duplicate code for GDB and LLDB. May be use a macro for this? I prefer not to, since it may have custom logging for debugger, and this will make the code less readable. > > diff --git a/test/tarantool-debugger-tests/debug-extension-tests.py b/test/tarantool-debugger-tests/debug-extension-tests.py > > new file mode 100644 > > index 00000000..6094c535 > > --- /dev/null > > +++ b/test/tarantool-debugger-tests/debug-extension-tests.py -- Best regards, Sergey Kaplun