* [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests
@ 2024-09-24 10:29 Sergey Kaplun via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory Sergey Kaplun via Tarantool-patches
` (7 more replies)
0 siblings, 8 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patchset shrinks the environment variables that are used in the
tarantool-tests suite. There will be no more huge, inconvenient
copy-pasting of LD_LIBRARY_PATH, LUA_CPATH. Also, it disables the flaky
profilers tests with the enabled table bump optimization.
Branch: https://github.com/tarantool/luajit/tree/skaplun/shrink-test-env
Related issue: https://github.com/tarantool/tarantool/issues/9898
Changes in v2:
Now BuildCTest accepts a list of tests as the last argument for which
the LUA_CPATH and LD_LIBRARY_PATH will be set. Ugly fixup for profilers
is gone.
Sergey Kaplun (7):
test: move profilers tests to subdirectory
test: rename <arm64-ccall-fp-convention.test.lua>
cmake: introduce AppendTestEnvVar macro
test: shrink LUA_PATH environment variable
test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
test: skip flaky tests with enabled table bump
test: set LD_PRELOAD only when necessary
test/tarantool-tests/CMakeLists.txt | 178 ++++++++++--------
...=> ffi-ccall-arm64-fp-convention.test.lua} | 2 +-
test/tarantool-tests/ffi-ccall/CMakeLists.txt | 2 +-
.../fix-bit-shift-generation/CMakeLists.txt | 3 +-
.../gh-4427-ffi-sandwich/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../gh-6189-cur_L/CMakeLists.txt | 3 +-
.../lj-1004-oom-error-frame/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-1166-error-stitch/CMakeLists.txt | 6 +-
.../lj-416-xor-before-jcc/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-549-bytecode-loader/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-601-fix-gc-finderrfunc/CMakeLists.txt | 3 +-
.../lj-727-lightuserdata-itern/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-flush-on-trace/CMakeLists.txt | 3 +-
.../gh-5688-tool-cli-flag.test.lua | 2 +
.../gh-5813-resolving-of-c-symbols.test.lua | 2 +
.../both/CMakeLists.txt | 4 +-
.../both/resboth.c | 0
.../gnuhash/CMakeLists.txt | 4 +-
.../gnuhash/resgnuhash.c | 0
.../hash/CMakeLists.txt | 4 +-
.../hash/reshash.c | 0
.../stripped/CMakeLists.txt | 4 +-
.../stripped/resstripped.c | 0
.../gh-5994-memprof-human-readable.test.lua | 2 +
...4-add-proto-trace-sysprof-default.test.lua | 2 +
...17-profile-parsers-error-handling.test.lua | 2 +
.../misclib-memprof-lapi.test.lua | 16 +-
.../misclib-sysprof-lapi.test.lua | 2 +
.../{ => profilers}/tools-utils-avl.test.lua | 0
34 files changed, 172 insertions(+), 102 deletions(-)
rename test/tarantool-tests/{arm64-ccall-fp-convention.test.lua => ffi-ccall-arm64-fp-convention.test.lua} (96%)
rename test/tarantool-tests/{ => profilers}/gh-5688-tool-cli-flag.test.lua (95%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols.test.lua (95%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt (78%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/both/resboth.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt (77%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/gnuhash/resgnuhash.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt (78%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/hash/reshash.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt (75%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/stripped/resstripped.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5994-memprof-human-readable.test.lua (93%)
rename test/tarantool-tests/{ => profilers}/gh-7264-add-proto-trace-sysprof-default.test.lua (90%)
rename test/tarantool-tests/{ => profilers}/gh-9217-profile-parsers-error-handling.test.lua (94%)
rename test/tarantool-tests/{ => profilers}/misclib-memprof-lapi.test.lua (92%)
rename test/tarantool-tests/{ => profilers}/misclib-sysprof-lapi.test.lua (96%)
rename test/tarantool-tests/{ => profilers}/tools-utils-avl.test.lua (100%)
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:28 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua> Sergey Kaplun via Tarantool-patches
` (6 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch moves tests for Tarantool's profilers like memprof and
sysprof to the corresponding subdirectory.
It is useful when we want to change the properties for these tests only.
Needed for tarantool/tarantool#9898
---
test/tarantool-tests/CMakeLists.txt | 10 +++++-----
.../{ => profilers}/gh-5688-tool-cli-flag.test.lua | 0
.../gh-5813-resolving-of-c-symbols.test.lua | 0
.../gh-5813-resolving-of-c-symbols/both/CMakeLists.txt | 0
.../gh-5813-resolving-of-c-symbols/both/resboth.c | 0
.../gnuhash/CMakeLists.txt | 0
.../gnuhash/resgnuhash.c | 0
.../gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt | 0
.../gh-5813-resolving-of-c-symbols/hash/reshash.c | 0
.../stripped/CMakeLists.txt | 0
.../stripped/resstripped.c | 0
.../gh-5994-memprof-human-readable.test.lua | 0
.../gh-7264-add-proto-trace-sysprof-default.test.lua | 0
.../gh-9217-profile-parsers-error-handling.test.lua | 0
.../{ => profilers}/misclib-memprof-lapi.test.lua | 0
.../{ => profilers}/misclib-sysprof-lapi.test.lua | 0
.../{ => profilers}/tools-utils-avl.test.lua | 0
17 files changed, 5 insertions(+), 5 deletions(-)
rename test/tarantool-tests/{ => profilers}/gh-5688-tool-cli-flag.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/both/resboth.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/gnuhash/resgnuhash.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/hash/reshash.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt (100%)
rename test/tarantool-tests/{ => profilers}/gh-5813-resolving-of-c-symbols/stripped/resstripped.c (100%)
rename test/tarantool-tests/{ => profilers}/gh-5994-memprof-human-readable.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/gh-7264-add-proto-trace-sysprof-default.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/gh-9217-profile-parsers-error-handling.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/misclib-memprof-lapi.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/misclib-sysprof-lapi.test.lua (100%)
rename test/tarantool-tests/{ => profilers}/tools-utils-avl.test.lua (100%)
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 0bd3e6fc..11a84496 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -21,10 +21,6 @@ endmacro()
add_subdirectory(ffi-ccall)
add_subdirectory(fix-bit-shift-generation)
add_subdirectory(gh-4427-ffi-sandwich)
-add_subdirectory(gh-5813-resolving-of-c-symbols/both)
-add_subdirectory(gh-5813-resolving-of-c-symbols/hash)
-add_subdirectory(gh-5813-resolving-of-c-symbols/gnuhash)
-add_subdirectory(gh-5813-resolving-of-c-symbols/stripped)
add_subdirectory(gh-6098-fix-side-exit-patching-on-arm64)
add_subdirectory(gh-6189-cur_L)
add_subdirectory(lj-416-xor-before-jcc)
@@ -38,6 +34,10 @@ add_subdirectory(lj-flush-on-trace)
add_subdirectory(lj-1004-oom-error-frame)
add_subdirectory(lj-1066-fix-cur_L-after-coroutine-resume)
add_subdirectory(lj-1166-error-stitch)
+add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/both)
+add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/gnuhash)
+add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/hash)
+add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/stripped)
# The part of the memory profiler toolchain is located in tools
# directory, jit, profiler, and bytecode toolchains are located
@@ -121,7 +121,7 @@ add_test_suite_target(tarantool-tests
file(GLOB_RECURSE tests ${CMAKE_CURRENT_SOURCE_DIR} "*${LUA_TEST_SUFFIX}")
foreach(test_path ${tests})
- get_filename_component(test_name ${test_path} NAME)
+ file(RELATIVE_PATH test_name ${CMAKE_CURRENT_SOURCE_DIR} ${test_path})
set(test_title "test/${TEST_SUITE_NAME}/${test_name}")
add_test(NAME ${test_title}
COMMAND ${LUAJIT_TEST_COMMAND} ${test_path}
diff --git a/test/tarantool-tests/gh-5688-tool-cli-flag.test.lua b/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
similarity index 100%
rename from test/tarantool-tests/gh-5688-tool-cli-flag.test.lua
rename to test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/both/resboth.c b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/resboth.c
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/both/resboth.c
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/resboth.c
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/gnuhash/resgnuhash.c b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/resgnuhash.c
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/gnuhash/resgnuhash.c
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/resgnuhash.c
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/hash/reshash.c b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/reshash.c
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/hash/reshash.c
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/reshash.c
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols/stripped/resstripped.c b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/resstripped.c
similarity index 100%
rename from test/tarantool-tests/gh-5813-resolving-of-c-symbols/stripped/resstripped.c
rename to test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/resstripped.c
diff --git a/test/tarantool-tests/gh-5994-memprof-human-readable.test.lua b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
similarity index 100%
rename from test/tarantool-tests/gh-5994-memprof-human-readable.test.lua
rename to test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
diff --git a/test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
similarity index 100%
rename from test/tarantool-tests/gh-7264-add-proto-trace-sysprof-default.test.lua
rename to test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
diff --git a/test/tarantool-tests/gh-9217-profile-parsers-error-handling.test.lua b/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
similarity index 100%
rename from test/tarantool-tests/gh-9217-profile-parsers-error-handling.test.lua
rename to test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
similarity index 100%
rename from test/tarantool-tests/misclib-memprof-lapi.test.lua
rename to test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
diff --git a/test/tarantool-tests/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
similarity index 100%
rename from test/tarantool-tests/misclib-sysprof-lapi.test.lua
rename to test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
diff --git a/test/tarantool-tests/tools-utils-avl.test.lua b/test/tarantool-tests/profilers/tools-utils-avl.test.lua
similarity index 100%
rename from test/tarantool-tests/tools-utils-avl.test.lua
rename to test/tarantool-tests/profilers/tools-utils-avl.test.lua
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua>
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:29 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro Sergey Kaplun via Tarantool-patches
` (5 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch renames the aforementioned file to
<ffi-ccall-arm64-fp-convention.test.lua> to make the prefix (ffi-ccall)
match the name of the directory containing the C library for the test.
Needed for tarantool/tarantool#9898
---
...nvention.test.lua => ffi-ccall-arm64-fp-convention.test.lua} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename test/tarantool-tests/{arm64-ccall-fp-convention.test.lua => ffi-ccall-arm64-fp-convention.test.lua} (96%)
diff --git a/test/tarantool-tests/arm64-ccall-fp-convention.test.lua b/test/tarantool-tests/ffi-ccall-arm64-fp-convention.test.lua
similarity index 96%
rename from test/tarantool-tests/arm64-ccall-fp-convention.test.lua
rename to test/tarantool-tests/ffi-ccall-arm64-fp-convention.test.lua
index c58ba697..053b7a3a 100644
--- a/test/tarantool-tests/arm64-ccall-fp-convention.test.lua
+++ b/test/tarantool-tests/ffi-ccall-arm64-fp-convention.test.lua
@@ -3,7 +3,7 @@ local tap = require('tap')
local ffi_ccall = ffi.load('libfficcall')
-local test = tap.test('arm64-ccall-fp-convention')
+local test = tap.test('ffi-ccall-arm64-fp-convention')
test:plan(3)
ffi.cdef[[
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory Sergey Kaplun via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua> Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:30 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable Sergey Kaplun via Tarantool-patches
` (4 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
It is useful to update the environment variable for some tests. For
CMake versions >= 3.22, we can use ENVIRONMENT_MODIFICATION [1] instead.
But unless we bump the CMake version, this macro is a workaround.
[1]: https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html
Part of tarantool/tarantool#9898
---
test/tarantool-tests/CMakeLists.txt | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 11a84496..ff402dc0 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -18,6 +18,34 @@ macro(BuildTestCLib lib sources)
set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}" PARENT_SCOPE)
endmacro()
+# FIXME: This is used only due to ancient CMake requirements.
+# If we update to CMake >= 3.22, we can use
+# ENVIRONMENT_MODIFICATION [1] instead.
+# [1]: https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html
+# This macro appends to the given test's environment variable the
+# given value. If the variable doesn't exist, it is created equal
+# to the given argument.
+macro(AppendTestEnvVar testname var value)
+ get_test_property(${testname} ENVIRONMENT old_env)
+ foreach(loopvar ${old_env})
+ # XXX: `foreach()` unescapes ";" in string, escape them back.
+ string(REPLACE ";" "\;" loopvar "${loopvar}")
+ if("${loopvar}" MATCHES "^${var}=(.*)")
+ set(envvar_found TRUE)
+ set(loopvar "${var}=${value}${CMAKE_MATCH_1}")
+ endif()
+ list(APPEND new_env "${loopvar}")
+ endforeach()
+ if(NOT "${envvar_found}")
+ list(APPEND new_env "${var}=${value}")
+ endif()
+ set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${new_env}")
+
+ unset(envvar_found)
+ unset(old_env)
+ unset(new_env)
+endmacro()
+
add_subdirectory(ffi-ccall)
add_subdirectory(fix-bit-shift-generation)
add_subdirectory(gh-4427-ffi-sandwich)
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
` (2 preceding siblings ...)
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 11:15 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:31 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH Sergey Kaplun via Tarantool-patches
` (3 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch removes the default adding of the tools directory to the
LUA_PATH. Now it is done only for profilers tests.
Part of tarantool/tarantool#9898
---
test/tarantool-tests/CMakeLists.txt | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index ff402dc0..5e3493b6 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -67,18 +67,16 @@ add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/gnuhash)
add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/hash)
add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/stripped)
-# The part of the memory profiler toolchain is located in tools
-# directory, jit, profiler, and bytecode toolchains are located
-# in src/ directory, jit/vmdef.lua is autogenerated file also
-# located in src/ directory, but in the scope of the binary
-# artefacts tree and auxiliary tests-related modules are located
+# JIT, profiler, and bytecode toolchains are located in the <src/>
+# directory, <jit/vmdef.lua> is the autogenerated file also
+# located in the <src/> directory, but in the scope of the binary
+# artifacts tree, and auxiliary tests-related modules are located
# in the current directory (but tests are run in the binary
-# directory), so LUA_PATH need to be updated.
+# directory), so LUA_PATH needs to be updated.
make_lua_path(LUA_PATH
PATHS
${CMAKE_CURRENT_SOURCE_DIR}/?.lua
${CMAKE_CURRENT_SOURCE_DIR}/?/init.lua
- ${PROJECT_SOURCE_DIR}/tools/?.lua
${LUAJIT_SOURCE_DIR}/?.lua
${LUAJIT_BINARY_DIR}/?.lua
)
@@ -163,4 +161,12 @@ foreach(test_path ${tests})
LABELS ${TEST_SUITE_NAME}
DEPENDS tarantool-tests-deps
)
+
+ # The part of the profilers toolchain is located in the <tools/>
+ # directory, so LUA_PATH needs to be updated.
+ if(test_name MATCHES "^profilers")
+ AppendTestEnvVar(${test_title}
+ LUA_PATH "${PROJECT_SOURCE_DIR}/tools/?.lua\;"
+ )
+ endif()
endforeach()
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
` (3 preceding siblings ...)
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 11:16 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:37 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump Sergey Kaplun via Tarantool-patches
` (2 subsequent siblings)
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch sets the unique value of each of these variables for each of
the tests and only where they are needed. Also, it drops the comment
about SIP [1] tricks since it is obsolete after
29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
utils.selfrun in tests").
[1]: https://support.apple.com/en-us/HT204899
Resolves tarantool/tarantool#9898
---
test/tarantool-tests/CMakeLists.txt | 85 ++++++++-----------
test/tarantool-tests/ffi-ccall/CMakeLists.txt | 2 +-
.../fix-bit-shift-generation/CMakeLists.txt | 3 +-
.../gh-4427-ffi-sandwich/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../gh-6189-cur_L/CMakeLists.txt | 3 +-
.../lj-1004-oom-error-frame/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-1166-error-stitch/CMakeLists.txt | 6 +-
.../lj-416-xor-before-jcc/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-549-bytecode-loader/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-601-fix-gc-finderrfunc/CMakeLists.txt | 3 +-
.../lj-727-lightuserdata-itern/CMakeLists.txt | 3 +-
.../CMakeLists.txt | 3 +-
.../lj-flush-on-trace/CMakeLists.txt | 3 +-
.../both/CMakeLists.txt | 4 +-
.../gnuhash/CMakeLists.txt | 4 +-
.../hash/CMakeLists.txt | 4 +-
.../stripped/CMakeLists.txt | 4 +-
21 files changed, 82 insertions(+), 69 deletions(-)
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 5e3493b6..d0964aed 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -5,17 +5,16 @@ add_custom_target(tarantool-tests-libs
DEPENDS libluajit
)
-macro(BuildTestCLib lib sources)
- AddTestLib(${lib} ${sources})
+macro(BuildTestCLib lib source for_tests)
+ AddTestLib(${lib} ${source})
add_dependencies(tarantool-tests-libs ${lib})
- # Add the directory where the lib is built to the list with
- # entries for LUA_CPATH environment variable, so LuaJIT can find
- # and load it. See the comment about extending the list in the
- # parent scope few lines above.
- set(LUA_CPATHS "${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX};${LUA_CPATHS}" PARENT_SCOPE)
- # Also add this directory to LD_LIBRARY_PATH environment
- # variable, so FFI machinery can find and load it.
- set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}" PARENT_SCOPE)
+ # Remember libraries for each test to be proceeded with after
+ # test targets are created.
+ foreach(testname ${for_tests})
+ set(LIBS_${testname}
+ "${CMAKE_CURRENT_BINARY_DIR};${LIBS_${testname}}" PARENT_SCOPE
+ )
+ endforeach()
endmacro()
# FIXME: This is used only due to ancient CMake requirements.
@@ -81,46 +80,8 @@ make_lua_path(LUA_PATH
${LUAJIT_BINARY_DIR}/?.lua
)
-# Update LUA_CPATH with the library paths collected within
-# <BuildTestLib> macro.
-make_lua_path(LUA_CPATH PATHS ${LUA_CPATHS})
-
set(LUA_TEST_SUFFIX .test.lua)
-# XXX: Since the auxiliary libraries are built as a dynamically
-# loaded modules on MacOS instead of shared libraries as it is
-# done on Linux and BSD, another environment variable should be
-# used to guide <ffi.load> while searching the extension.
-# XXX: Be noticed that we shouldn't use `"` here to wrap
-# the variable's content. If we do this, the variable value will
-# contain `"` at the beginning and the end, so this `"` at the
-# beginning will be treated as the directory for the first entry
-# (the last subdirectory added).
-if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
- # XXX: Apple tries their best to "protect their users from
- # malware". As a result SIP (see the link[1] below) has been
- # designed and released. Now, Apple developers are so protected,
- # that they can load nothing being not installed in the system,
- # since some programs sanitize the environment before they start
- # child processes. Specifically, environment variables starting
- # with DYLD_ and LD_ are unset for child process started by
- # other programs (like `ctest` using for launching tests).
- # For more info, see the docs[2] below.
- #
- # These environment variables are used by FFI machinery to find
- # the proper shared library, hence we can still tweak testing
- # environment before calling <ffi.load>. However, the value
- # can't be passed via the standard environment variable, so we
- # use ENVIRONMENT property in `set_tests_properties` to get
- # around SIP magic tricks.
- #
- # [1]: https://support.apple.com/en-us/HT204899
- # [2]: https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html
- list(APPEND LUA_TEST_ENV_MORE DYLD_LIBRARY_PATH=${LD_LIBRARY_PATH})
-else()
- list(APPEND LUA_TEST_ENV_MORE LD_LIBRARY_PATH=${LD_LIBRARY_PATH})
-endif()
-
# Some tests use `LD_PRELOAD` to mock system calls (like
# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
# `mprotect()`. When compiling with ASan support under GCC, it is
@@ -157,7 +118,7 @@ foreach(test_path ${tests})
# LUA_CPATH and LD_LIBRARY_PATH variables and also
# dependencies list with libraries are set in scope of
# BuildTestLib macro.
- ENVIRONMENT "LUA_PATH=${LUA_PATH};LUA_CPATH=${LUA_CPATH};${LUA_TEST_ENV_MORE}"
+ ENVIRONMENT "LUA_PATH=${LUA_PATH};${LUA_TEST_ENV_MORE}"
LABELS ${TEST_SUITE_NAME}
DEPENDS tarantool-tests-deps
)
@@ -169,4 +130,30 @@ foreach(test_path ${tests})
LUA_PATH "${PROJECT_SOURCE_DIR}/tools/?.lua\;"
)
endif()
+
+ if(LIBS_${test_name})
+ foreach(path ${LIBS_${test_name}})
+ # Add the directory where the library is built to the list
+ # with entries for the LUA_CPATH environment variable, so
+ # LuaJIT can find and load it.
+ AppendTestEnvVar(${test_title}
+ LUA_CPATH "${path}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;"
+ )
+ # Also, add this directory to the LD_LIBRARY_PATH environment
+ # variable so FFI machinery can find and load it.
+ # XXX: Be noticed that we shouldn't use `"` here to wrap the
+ # variable's content. If we do this, the variable value will
+ # contain `"` at the beginning and the end, so this `"` at the
+ # beginning will be treated as the directory for the entry.
+ # XXX: Since the auxiliary libraries are built as dynamically
+ # loaded modules on MacOS instead of shared libraries as it is
+ # done on Linux and BSD, another environment variable should
+ # be used to guide <ffi.load> while searching the extension.
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ AppendTestEnvVar(${test_title} DYLD_LIBRARY_PATH ${path}:)
+ else()
+ AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
+ endif()
+ endforeach()
+ endif()
endforeach()
diff --git a/test/tarantool-tests/ffi-ccall/CMakeLists.txt b/test/tarantool-tests/ffi-ccall/CMakeLists.txt
index df937bf8..8acd8fe4 100644
--- a/test/tarantool-tests/ffi-ccall/CMakeLists.txt
+++ b/test/tarantool-tests/ffi-ccall/CMakeLists.txt
@@ -1 +1 @@
-BuildTestCLib(libfficcall libfficcall.c)
+BuildTestCLib(libfficcall libfficcall.c ffi-ccall-arm64-fp-convention.test.lua)
diff --git a/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt b/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt
index f85f875b..597b0088 100644
--- a/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt
+++ b/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libtestbitshift libtestbitshift.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libtestbitshift libtestbitshift.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt b/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt
index f2be5493..7766373d 100644
--- a/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt
+++ b/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libsandwich libsandwich.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libsandwich libsandwich.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt
index 361d0cd7..381577fb 100644
--- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt
+++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libproxy libproxy.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libproxy libproxy.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt b/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt
index 1e58e560..11dbfa6b 100644
--- a/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt
+++ b/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libcur_L libcur_L.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libcur_L libcur_L.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt b/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt
index 3bca5df8..865e4d26 100644
--- a/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt
+++ b/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(testoomframe testoomframe.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(testoomframe testoomframe.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt b/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt
index c8a3731f..7b507b81 100644
--- a/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt
+++ b/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libcur_L_coroutine libcur_L_coroutine.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libcur_L_coroutine libcur_L_coroutine.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt b/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt
index 342e438e..658b3b8c 100644
--- a/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt
+++ b/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt
@@ -1 +1,5 @@
-BuildTestCLib(allocinject allocinject.c)
+list(APPEND tests
+ lj-1166-error-stitch-oom-ir-buff.test.lua
+ lj-1166-error-stitch-oom-snap-buff.test.lua
+)
+BuildTestCLib(allocinject allocinject.c "${tests}")
diff --git a/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt b/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt
index 17aa9f9b..e25863a4 100644
--- a/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt
+++ b/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libtestxor testxor.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libtestxor testxor.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt b/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt
index 903da4d3..c4383b37 100644
--- a/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt
+++ b/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(mydlerror mydlerror.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(mydlerror mydlerror.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt b/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt
index d66c4935..515de667 100644
--- a/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt
+++ b/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt
@@ -17,5 +17,6 @@ add_custom_target(export_bc
VERBATIM
)
-BuildTestCLib(${LIB_NAME} ${C_FILE})
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(${LIB_NAME} ${C_FILE} ${test_name}.test.lua)
add_dependencies(${LIB_NAME} export_bc)
diff --git a/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt b/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt
index 1f3e8fe6..89f8583f 100644
--- a/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt
+++ b/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt
@@ -27,7 +27,8 @@ macro(BuildTestBCLib file_ext)
VERBATIM
)
- BuildTestCLib(${LIB_NAME} ${EXT_SOURCE})
+ get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+ BuildTestCLib(${LIB_NAME} ${EXT_SOURCE} ${test_name}.test.lua)
add_dependencies(${LIB_NAME} export_bc_${file_ext})
endmacro()
diff --git a/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt b/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt
index 3fed6105..31c9fa3b 100644
--- a/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt
+++ b/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libmixcframe mixcframe.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libmixcframe mixcframe.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt b/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt
index 564b688b..1161017d 100644
--- a/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt
+++ b/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(lightuserdata lightuserdata.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(lightuserdata lightuserdata.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt b/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt
index 25520a1a..39c7532a 100644
--- a/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt
+++ b/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(mymprotect mymprotect.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(mymprotect mymprotect.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt b/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt
index 16f1aa8f..7dfea075 100644
--- a/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt
+++ b/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt
@@ -1 +1,2 @@
-BuildTestCLib(libflush libflush.c)
+get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+BuildTestCLib(libflush libflush.c ${test_name}.test.lua)
diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
index ce616fcf..bf980c7d 100644
--- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
+++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
@@ -1,5 +1,7 @@
if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
- BuildTestCLib(resboth resboth.c)
+ BuildTestCLib(resboth resboth.c
+ profilers/gh-5813-resolving-of-c-symbols.test.lua
+ )
# Unfortunately, <target_link_options> command is introduced
# since CMake 3.13, so we can't use it now considering ancient
# distros support. Just build linker flags by hands.
diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
index 1179601b..b80129a3 100644
--- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
+++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
@@ -1,5 +1,7 @@
if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
- BuildTestCLib(resgnuhash resgnuhash.c)
+ BuildTestCLib(resgnuhash resgnuhash.c
+ profilers/gh-5813-resolving-of-c-symbols.test.lua
+ )
# Unfortunately, <target_link_options> command is introduced
# since CMake 3.13, so we can't use it now considering ancient
# distros support. Just build linker flags by hands.
diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
index e0ad5675..0633f1f3 100644
--- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
+++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
@@ -1,5 +1,7 @@
if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
- BuildTestCLib(reshash reshash.c)
+ BuildTestCLib(reshash reshash.c
+ profilers/gh-5813-resolving-of-c-symbols.test.lua
+ )
# Unfortunately, <target_link_options> command is introduced
# since CMake 3.13, so we can't use it now considering ancient
# distros support. Just build linker flags by hands.
diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
index 243902be..2ea0b4ac 100644
--- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
+++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
@@ -1,5 +1,7 @@
if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
- BuildTestCLib(resstripped resstripped.c)
+ BuildTestCLib(resstripped resstripped.c
+ profilers/gh-5813-resolving-of-c-symbols.test.lua
+ )
# Unfortunately, <target_link_options> command is introduced
# since CMake 3.13, so we can't use it now considering ancient
# distros support. Just build linker flags by hands.
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
` (4 preceding siblings ...)
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 11:26 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:38 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary Sergey Kaplun via Tarantool-patches
2024-10-18 15:18 ` [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
Profilers tests with LUAJIT_ENABLE_TABLE_BUMP are flaky due to the bug
in the TDUP patching. Disable them for now.
---
test/tarantool-tests/CMakeLists.txt | 6 ++++++
.../profilers/gh-5688-tool-cli-flag.test.lua | 2 ++
.../gh-5813-resolving-of-c-symbols.test.lua | 2 ++
.../gh-5994-memprof-human-readable.test.lua | 2 ++
...7264-add-proto-trace-sysprof-default.test.lua | 2 ++
...-9217-profile-parsers-error-handling.test.lua | 2 ++
.../profilers/misclib-memprof-lapi.test.lua | 16 +++++++++-------
.../profilers/misclib-sysprof-lapi.test.lua | 2 ++
8 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index d0964aed..a1aee3a2 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -97,6 +97,12 @@ if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND LUA_TEST_ENV_MORE LD_PRELOAD=${LIB_ASAN})
endif()
+# FIXME: This is needed for disabling some flaky tests (like
+# profilers), until LuaJIT/LuaJIT#606 will not be resolved.
+if(LUAJIT_ENABLE_TABLE_BUMP)
+ list(APPEND LUA_TEST_ENV_MORE LUAJIT_TABLE_BUMP=1)
+endif()
+
set(TEST_SUITE_NAME "tarantool-tests")
# XXX: The call produces both test and target
diff --git a/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua b/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
index dd0fd260..f935dc5b 100644
--- a/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
+++ b/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
@@ -5,6 +5,8 @@ local test = tap.test('gh-5688-tool-cli-flag'):skipcond({
['Profile tools are implemented for Linux only'] = jit.os ~= 'Linux',
-- XXX: Tarantool integration is required to run this test properly.
['No profile tools CLI option integration'] = _TARANTOOL,
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
})
test:plan(3)
diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
index 1581ee4b..74bcd9e8 100644
--- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
+++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
@@ -3,6 +3,8 @@ local test = tap.test("gh-5813-resolving-of-c-symbols"):skipcond({
["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
jit.arch ~= "x64",
["Memprof is implemented for Linux only"] = jit.os ~= "Linux",
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
})
test:plan(5)
diff --git a/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
index 7c3ff94d..f3041779 100644
--- a/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
+++ b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
@@ -5,6 +5,8 @@ local test = tap.test('gh-5994-memprof-human-readable'):skipcond({
['Profile tools are implemented for Linux only'] = jit.os ~= 'Linux',
-- XXX: Tarantool integration is required to run this test properly.
['No profile tools CLI option integration'] = _TARANTOOL,
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
})
local utils = require('utils')
diff --git a/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
index c1d68e3c..176c1a15 100644
--- a/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
+++ b/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
@@ -4,6 +4,8 @@ local test = tap.test('gh-7264-add-proto-trace-sysprof-default'):skipcond({
['Sysprof is implemented for x86_64 only'] = jit.arch ~= 'x86' and
jit.arch ~= 'x64',
['Sysprof is implemented for Linux only'] = jit.os ~= 'Linux',
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
})
test:plan(2)
diff --git a/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua b/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
index 92f9f59d..65c51198 100644
--- a/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
+++ b/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
@@ -5,6 +5,8 @@ local test = tap.test('gh-9217-profile-parsers-error-handling'):skipcond({
['Profile tools are implemented for Linux only'] = jit.os ~= 'Linux',
-- XXX: Tarantool integration is required to run this test properly.
['No profile tools CLI option integration'] = _TARANTOOL,
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
})
jit.off()
diff --git a/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
index 728a7ab7..ce41e4d5 100644
--- a/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
+++ b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
@@ -6,6 +6,8 @@ local test = tap.test("misc-memprof-lapi"):skipcond({
['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
jit.arch ~= "x64",
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
})
test:plan(5)
@@ -162,9 +164,9 @@ test:test("output", function(subtest)
-- one is the number of allocations. 1 event - allocation of
-- table by itself + 1 allocation of array part as far it is
-- bigger than LJ_MAX_COLOSIZE (16).
- subtest:ok(check_alloc_report(alloc, { line = 37, linedefined = 35 }, 2))
+ subtest:ok(check_alloc_report(alloc, { line = 39, linedefined = 37 }, 2))
-- 20 strings allocations.
- subtest:ok(check_alloc_report(alloc, { line = 42, linedefined = 35 }, 20))
+ subtest:ok(check_alloc_report(alloc, { line = 44, linedefined = 37 }, 20))
-- Collect all previous allocated objects.
subtest:ok(free.INTERNAL == 22)
@@ -172,8 +174,8 @@ test:test("output", function(subtest)
-- Tests for leak-only option.
-- See also https://github.com/tarantool/tarantool/issues/5812.
local heap_delta = process.form_heap_delta(events)
- local tab_alloc_stats = heap_delta[form_source_line(37)]
- local str_alloc_stats = heap_delta[form_source_line(42)]
+ local tab_alloc_stats = heap_delta[form_source_line(39)]
+ local str_alloc_stats = heap_delta[form_source_line(44)]
subtest:ok(tab_alloc_stats.nalloc == tab_alloc_stats.nfree)
subtest:ok(tab_alloc_stats.dbytes == 0)
subtest:ok(str_alloc_stats.nalloc == str_alloc_stats.nfree)
@@ -258,10 +260,10 @@ test:test("jit-output", function(subtest)
-- 10 allocations in interpreter mode, 1 allocation for a trace
-- recording and assembling and next 9 allocations will happen
-- while running the trace.
- subtest:ok(check_alloc_report(alloc, { line = 42, linedefined = 35 }, 11))
- subtest:ok(check_alloc_report(alloc, { traceno = 1, line = 40 }, 9))
+ subtest:ok(check_alloc_report(alloc, { line = 44, linedefined = 37 }, 11))
+ subtest:ok(check_alloc_report(alloc, { traceno = 1, line = 42 }, 9))
-- See same checks with jit.off().
- subtest:ok(check_alloc_report(alloc, { line = 37, linedefined = 35 }, 2))
+ subtest:ok(check_alloc_report(alloc, { line = 39, linedefined = 37 }, 2))
-- Restore default JIT settings.
jit.opt.start(unpack(jit_opt_default))
diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
index fdaed46a..26c277cd 100644
--- a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
+++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
@@ -3,6 +3,8 @@ local test = tap.test("misc-sysprof-lapi"):skipcond({
["Sysprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
jit.arch ~= "x64",
["Sysprof is implemented for Linux only"] = jit.os ~= "Linux",
+ -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
+ ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
})
test:plan(19)
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
` (5 preceding siblings ...)
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump Sergey Kaplun via Tarantool-patches
@ 2024-09-24 10:29 ` Sergey Kaplun via Tarantool-patches
2024-09-24 14:13 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:46 ` Maxim Kokryashkin via Tarantool-patches
2024-10-18 15:18 ` [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
7 siblings, 2 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 10:29 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
This patch sets LD_PRELOAD for ASan build for the required tests instead
of all tests.
Follows up tarantool/tarantool#9898
---
test/tarantool-tests/CMakeLists.txt | 33 ++++++++++++++++-------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index a1aee3a2..74086ca4 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -82,21 +82,6 @@ make_lua_path(LUA_PATH
set(LUA_TEST_SUFFIX .test.lua)
-# Some tests use `LD_PRELOAD` to mock system calls (like
-# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
-# `mprotect()`. When compiling with ASan support under GCC, it is
-# required that the ASan library go first in the `LD_PRELOAD`
-# list. Set it manually. The test will append it to the executed
-# process.
-if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
- # FIXME: We should set this environment variable only
- # for the corresponding tests to avoid warnings from
- # the GNU libc and other libc implementations.
- # See https://github.com/tarantool/tarantool/issues/9898.
- LibRealPath(LIB_ASAN libasan.so)
- list(APPEND LUA_TEST_ENV_MORE LD_PRELOAD=${LIB_ASAN})
-endif()
-
# FIXME: This is needed for disabling some flaky tests (like
# profilers), until LuaJIT/LuaJIT#606 will not be resolved.
if(LUAJIT_ENABLE_TABLE_BUMP)
@@ -163,3 +148,21 @@ foreach(test_path ${tests})
endforeach()
endif()
endforeach()
+
+# Some tests use `LD_PRELOAD` to mock system calls (like
+# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
+# `mprotect()`). When compiling with ASan support under GCC, it is
+# required that the ASan library go first in the `LD_PRELOAD`
+# list. Set it manually. The test will append it to the executed
+# process.
+if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ LibRealPath(LIB_ASAN libasan.so)
+ AppendTestEnvVar(
+ "test/${TEST_SUITE_NAME}/lj-522-fix-dlerror-return-null.test.lua"
+ LD_PRELOAD ${LIB_ASAN}
+ )
+ AppendTestEnvVar(
+ "test/${TEST_SUITE_NAME}/lj-802-panic-at-mcode-protfail.test.lua"
+ LD_PRELOAD ${LIB_ASAN}
+ )
+endif()
--
2.46.0
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory Sergey Kaplun via Tarantool-patches
@ 2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:28 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 11:07 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
Hi, Sergey,
LGTM
On 24.09.2024 13:29, Sergey Kaplun wrote:
> This patch moves tests for Tarantool's profilers like memprof and
> sysprof to the corresponding subdirectory.
> It is useful when we want to change the properties for these tests only.
>
> Needed for tarantool/tarantool#9898
[-- Attachment #2: Type: text/html, Size: 774 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua>
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua> Sergey Kaplun via Tarantool-patches
@ 2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:29 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 11:07 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
Hi, Sergey
LGTM
On 24.09.2024 13:29, Sergey Kaplun wrote:
> This patch renames the aforementioned file to
> <ffi-ccall-arm64-fp-convention.test.lua> to make the prefix (ffi-ccall)
> match the name of the directory containing the C library for the test.
>
> Needed for tarantool/tarantool#9898
> ---
> ...nvention.test.lua => ffi-ccall-arm64-fp-convention.test.lua} | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> rename test/tarantool-tests/{arm64-ccall-fp-convention.test.lua => ffi-ccall-arm64-fp-convention.test.lua} (96%)
>
> diff --git a/test/tarantool-tests/arm64-ccall-fp-convention.test.lua b/test/tarantool-tests/ffi-ccall-arm64-fp-convention.test.lua
> similarity index 96%
> rename from test/tarantool-tests/arm64-ccall-fp-convention.test.lua
> rename to test/tarantool-tests/ffi-ccall-arm64-fp-convention.test.lua
> index c58ba697..053b7a3a 100644
> --- a/test/tarantool-tests/arm64-ccall-fp-convention.test.lua
> +++ b/test/tarantool-tests/ffi-ccall-arm64-fp-convention.test.lua
> @@ -3,7 +3,7 @@ local tap = require('tap')
>
> local ffi_ccall = ffi.load('libfficcall')
>
> -local test = tap.test('arm64-ccall-fp-convention')
> +local test = tap.test('ffi-ccall-arm64-fp-convention')
> test:plan(3)
>
> ffi.cdef[[
[-- Attachment #2: Type: text/html, Size: 1727 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro Sergey Kaplun via Tarantool-patches
@ 2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:30 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 11:07 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2133 bytes --]
Hi, Sergey
LGTM
On 24.09.2024 13:29, Sergey Kaplun wrote:
> It is useful to update the environment variable for some tests. For
> CMake versions >= 3.22, we can use ENVIRONMENT_MODIFICATION [1] instead.
> But unless we bump the CMake version, this macro is a workaround.
>
> [1]:https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html
>
> Part of tarantool/tarantool#9898
> ---
> test/tarantool-tests/CMakeLists.txt | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index 11a84496..ff402dc0 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -18,6 +18,34 @@ macro(BuildTestCLib lib sources)
> set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}" PARENT_SCOPE)
> endmacro()
>
> +# FIXME: This is used only due to ancient CMake requirements.
> +# If we update to CMake >= 3.22, we can use
> +# ENVIRONMENT_MODIFICATION [1] instead.
> +# [1]:https://cmake.org/cmake/help/latest/prop_test/ENVIRONMENT_MODIFICATION.html
> +# This macro appends to the given test's environment variable the
> +# given value. If the variable doesn't exist, it is created equal
> +# to the given argument.
> +macro(AppendTestEnvVar testname var value)
> + get_test_property(${testname} ENVIRONMENT old_env)
> + foreach(loopvar ${old_env})
> + # XXX: `foreach()` unescapes ";" in string, escape them back.
> + string(REPLACE ";" "\;" loopvar "${loopvar}")
> + if("${loopvar}" MATCHES "^${var}=(.*)")
> + set(envvar_found TRUE)
> + set(loopvar "${var}=${value}${CMAKE_MATCH_1}")
> + endif()
> + list(APPEND new_env "${loopvar}")
> + endforeach()
> + if(NOT "${envvar_found}")
> + list(APPEND new_env "${var}=${value}")
> + endif()
> + set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${new_env}")
> +
> + unset(envvar_found)
> + unset(old_env)
> + unset(new_env)
> +endmacro()
> +
> add_subdirectory(ffi-ccall)
> add_subdirectory(fix-bit-shift-generation)
> add_subdirectory(gh-4427-ffi-sandwich)
[-- Attachment #2: Type: text/html, Size: 2791 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable Sergey Kaplun via Tarantool-patches
@ 2024-09-24 11:15 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 11:33 ` Sergey Kaplun via Tarantool-patches
2024-10-11 18:31 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 11:15 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]
Hi, Sergey,
On 24.09.2024 13:29, Sergey Kaplun wrote:
> This patch removes the default adding of the tools directory to the
> LUA_PATH. Now it is done only for profilers tests.
>
> Part of tarantool/tarantool#9898
> ---
> test/tarantool-tests/CMakeLists.txt | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index ff402dc0..5e3493b6 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -67,18 +67,16 @@ add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/gnuhash)
> add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/hash)
> add_subdirectory(profilers/gh-5813-resolving-of-c-symbols/stripped)
>
> -# The part of the memory profiler toolchain is located in tools
> -# directory, jit, profiler, and bytecode toolchains are located
> -# in src/ directory, jit/vmdef.lua is autogenerated file also
> -# located in src/ directory, but in the scope of the binary
> -# artefacts tree and auxiliary tests-related modules are located
> +# JIT, profiler, and bytecode toolchains are located in the <src/>
> +# directory, <jit/vmdef.lua> is the autogenerated file also
> +# located in the <src/> directory, but in the scope of the binary
> +# artifacts tree, and auxiliary tests-related modules are located
> # in the current directory (but tests are run in the binary
> -# directory), so LUA_PATH need to be updated.
> +# directory), so LUA_PATH needs to be updated.
> make_lua_path(LUA_PATH
> PATHS
> ${CMAKE_CURRENT_SOURCE_DIR}/?.lua
> ${CMAKE_CURRENT_SOURCE_DIR}/?/init.lua
> - ${PROJECT_SOURCE_DIR}/tools/?.lua
> ${LUAJIT_SOURCE_DIR}/?.lua
> ${LUAJIT_BINARY_DIR}/?.lua
> )
> @@ -163,4 +161,12 @@ foreach(test_path ${tests})
> LABELS ${TEST_SUITE_NAME}
> DEPENDS tarantool-tests-deps
> )
> +
> + # The part of the profilers toolchain is located in the <tools/>
> + # directory, so LUA_PATH needs to be updated.
> + if(test_name MATCHES "^profilers")
> + AppendTestEnvVar(${test_title}
> + LUA_PATH "${PROJECT_SOURCE_DIR}/tools/?.lua\;"
> + )
> + endif()
> endforeach()
AFAIR, we decided to move the last hunk to profilers/CMakeLists.txt.
[-- Attachment #2: Type: text/html, Size: 2738 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH Sergey Kaplun via Tarantool-patches
@ 2024-09-24 11:16 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 11:28 ` Sergey Kaplun via Tarantool-patches
2024-10-11 18:37 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 11:16 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 19176 bytes --]
Hi, Sergey,
thanks for the updated patch!
I'm happy to see how much code was removed.
See my comments below.
On 24.09.2024 13:29, Sergey Kaplun wrote:
> This patch sets the unique value of each of these variables for each of
> the tests and only where they are needed. Also, it drops the comment
> about SIP [1] tricks since it is obsolete after
> 29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
> utils.selfrun in tests").
>
> [1]:https://support.apple.com/en-us/HT204899
>
> Resolves tarantool/tarantool#9898
> ---
> test/tarantool-tests/CMakeLists.txt | 85 ++++++++-----------
> test/tarantool-tests/ffi-ccall/CMakeLists.txt | 2 +-
> .../fix-bit-shift-generation/CMakeLists.txt | 3 +-
> .../gh-4427-ffi-sandwich/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../gh-6189-cur_L/CMakeLists.txt | 3 +-
> .../lj-1004-oom-error-frame/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-1166-error-stitch/CMakeLists.txt | 6 +-
> .../lj-416-xor-before-jcc/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-549-bytecode-loader/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-601-fix-gc-finderrfunc/CMakeLists.txt | 3 +-
> .../lj-727-lightuserdata-itern/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-flush-on-trace/CMakeLists.txt | 3 +-
> .../both/CMakeLists.txt | 4 +-
> .../gnuhash/CMakeLists.txt | 4 +-
> .../hash/CMakeLists.txt | 4 +-
> .../stripped/CMakeLists.txt | 4 +-
> 21 files changed, 82 insertions(+), 69 deletions(-)
>
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index 5e3493b6..d0964aed 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -5,17 +5,16 @@ add_custom_target(tarantool-tests-libs
> DEPENDS libluajit
> )
>
> -macro(BuildTestCLib lib sources)
> - AddTestLib(${lib} ${sources})
> +macro(BuildTestCLib lib source for_tests)
> + AddTestLib(${lib} ${source})
> add_dependencies(tarantool-tests-libs ${lib})
> - # Add the directory where the lib is built to the list with
> - # entries for LUA_CPATH environment variable, so LuaJIT can find
> - # and load it. See the comment about extending the list in the
> - # parent scope few lines above.
> - set(LUA_CPATHS "${CMAKE_CURRENT_BINARY_DIR}/?${CMAKE_SHARED_LIBRARY_SUFFIX};${LUA_CPATHS}" PARENT_SCOPE)
> - # Also add this directory to LD_LIBRARY_PATH environment
> - # variable, so FFI machinery can find and load it.
> - set(LD_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}:${LD_LIBRARY_PATH}" PARENT_SCOPE)
> + # Remember libraries for each test to be proceeded with after
> + # test targets are created.
> + foreach(testname ${for_tests})
> + set(LIBS_${testname}
> + "${CMAKE_CURRENT_BINARY_DIR};${LIBS_${testname}}" PARENT_SCOPE
> + )
> + endforeach()
> endmacro()
>
> # FIXME: This is used only due to ancient CMake requirements.
> @@ -81,46 +80,8 @@ make_lua_path(LUA_PATH
> ${LUAJIT_BINARY_DIR}/?.lua
> )
>
> -# Update LUA_CPATH with the library paths collected within
> -# <BuildTestLib> macro.
> -make_lua_path(LUA_CPATH PATHS ${LUA_CPATHS})
> -
> set(LUA_TEST_SUFFIX .test.lua)
>
> -# XXX: Since the auxiliary libraries are built as a dynamically
> -# loaded modules on MacOS instead of shared libraries as it is
> -# done on Linux and BSD, another environment variable should be
> -# used to guide <ffi.load> while searching the extension.
> -# XXX: Be noticed that we shouldn't use `"` here to wrap
> -# the variable's content. If we do this, the variable value will
> -# contain `"` at the beginning and the end, so this `"` at the
> -# beginning will be treated as the directory for the first entry
> -# (the last subdirectory added).
> -if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
> - # XXX: Apple tries their best to "protect their users from
> - # malware". As a result SIP (see the link[1] below) has been
> - # designed and released. Now, Apple developers are so protected,
> - # that they can load nothing being not installed in the system,
> - # since some programs sanitize the environment before they start
> - # child processes. Specifically, environment variables starting
> - # with DYLD_ and LD_ are unset for child process started by
> - # other programs (like `ctest` using for launching tests).
> - # For more info, see the docs[2] below.
> - #
> - # These environment variables are used by FFI machinery to find
> - # the proper shared library, hence we can still tweak testing
> - # environment before calling <ffi.load>. However, the value
> - # can't be passed via the standard environment variable, so we
> - # use ENVIRONMENT property in `set_tests_properties` to get
> - # around SIP magic tricks.
> - #
> - # [1]:https://support.apple.com/en-us/HT204899
> - # [2]:https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html
> - list(APPEND LUA_TEST_ENV_MORE DYLD_LIBRARY_PATH=${LD_LIBRARY_PATH})
> -else()
> - list(APPEND LUA_TEST_ENV_MORE LD_LIBRARY_PATH=${LD_LIBRARY_PATH})
> -endif()
> -
> # Some tests use `LD_PRELOAD` to mock system calls (like
> # <lj-802-panic-at-mcode-protfail.test.lua> overwrites
> # `mprotect()`. When compiling with ASan support under GCC, it is
> @@ -157,7 +118,7 @@ foreach(test_path ${tests})
> # LUA_CPATH and LD_LIBRARY_PATH variables and also
> # dependencies list with libraries are set in scope of
> # BuildTestLib macro.
> - ENVIRONMENT "LUA_PATH=${LUA_PATH};LUA_CPATH=${LUA_CPATH};${LUA_TEST_ENV_MORE}"
> + ENVIRONMENT "LUA_PATH=${LUA_PATH};${LUA_TEST_ENV_MORE}"
> LABELS ${TEST_SUITE_NAME}
> DEPENDS tarantool-tests-deps
> )
> @@ -169,4 +130,30 @@ foreach(test_path ${tests})
> LUA_PATH "${PROJECT_SOURCE_DIR}/tools/?.lua\;"
> )
> endif()
> +
> + if(LIBS_${test_name})
> + foreach(path ${LIBS_${test_name}})
> + # Add the directory where the library is built to the list
> + # with entries for the LUA_CPATH environment variable, so
> + # LuaJIT can find and load it.
> + AppendTestEnvVar(${test_title}
> + LUA_CPATH "${path}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;"
> + )
> + # Also, add this directory to the LD_LIBRARY_PATH environment
> + # variable so FFI machinery can find and load it.
> + # XXX: Be noticed that we shouldn't use `"` here to wrap the
> + # variable's content. If we do this, the variable value will
> + # contain `"` at the beginning and the end, so this `"` at the
> + # beginning will be treated as the directory for the entry.
> + # XXX: Since the auxiliary libraries are built as dynamically
> + # loaded modules on MacOS instead of shared libraries as it is
> + # done on Linux and BSD, another environment variable should
> + # be used to guide <ffi.load> while searching the extension.
> + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
> + AppendTestEnvVar(${test_title} DYLD_LIBRARY_PATH ${path}:)
> + else()
> + AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
> + endif()
please add unset(LIBS_${test_name})
> + endforeach()
> + endif()
> endforeach()
> diff --git a/test/tarantool-tests/ffi-ccall/CMakeLists.txt b/test/tarantool-tests/ffi-ccall/CMakeLists.txt
> index df937bf8..8acd8fe4 100644
> --- a/test/tarantool-tests/ffi-ccall/CMakeLists.txt
> +++ b/test/tarantool-tests/ffi-ccall/CMakeLists.txt
> @@ -1 +1 @@
> -BuildTestCLib(libfficcall libfficcall.c)
> +BuildTestCLib(libfficcall libfficcall.c ffi-ccall-arm64-fp-convention.test.lua)
> diff --git a/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt b/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt
> index f85f875b..597b0088 100644
> --- a/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt
> +++ b/test/tarantool-tests/fix-bit-shift-generation/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libtestbitshift libtestbitshift.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libtestbitshift libtestbitshift.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt b/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt
> index f2be5493..7766373d 100644
> --- a/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt
> +++ b/test/tarantool-tests/gh-4427-ffi-sandwich/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libsandwich libsandwich.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libsandwich libsandwich.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt
> index 361d0cd7..381577fb 100644
> --- a/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt
> +++ b/test/tarantool-tests/gh-6098-fix-side-exit-patching-on-arm64/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libproxy libproxy.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libproxy libproxy.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt b/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt
> index 1e58e560..11dbfa6b 100644
> --- a/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt
> +++ b/test/tarantool-tests/gh-6189-cur_L/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libcur_L libcur_L.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libcur_L libcur_L.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt b/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt
> index 3bca5df8..865e4d26 100644
> --- a/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-1004-oom-error-frame/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(testoomframe testoomframe.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(testoomframe testoomframe.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt b/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt
> index c8a3731f..7b507b81 100644
> --- a/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-1066-fix-cur_L-after-coroutine-resume/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libcur_L_coroutine libcur_L_coroutine.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libcur_L_coroutine libcur_L_coroutine.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt b/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt
> index 342e438e..658b3b8c 100644
> --- a/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-1166-error-stitch/CMakeLists.txt
> @@ -1 +1,5 @@
> -BuildTestCLib(allocinject allocinject.c)
> +list(APPEND tests
> + lj-1166-error-stitch-oom-ir-buff.test.lua
> + lj-1166-error-stitch-oom-snap-buff.test.lua
> +)
> +BuildTestCLib(allocinject allocinject.c "${tests}")
> diff --git a/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt b/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt
> index 17aa9f9b..e25863a4 100644
> --- a/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-416-xor-before-jcc/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libtestxor testxor.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libtestxor testxor.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt b/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt
> index 903da4d3..c4383b37 100644
> --- a/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-522-fix-dlerror-return-null/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(mydlerror mydlerror.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(mydlerror mydlerror.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt b/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt
> index d66c4935..515de667 100644
> --- a/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-549-bytecode-loader/CMakeLists.txt
> @@ -17,5 +17,6 @@ add_custom_target(export_bc
> VERBATIM
> )
>
> -BuildTestCLib(${LIB_NAME} ${C_FILE})
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(${LIB_NAME} ${C_FILE} ${test_name}.test.lua)
> add_dependencies(${LIB_NAME} export_bc)
> diff --git a/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt b/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt
> index 1f3e8fe6..89f8583f 100644
> --- a/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-551-bytecode-c-broken-macro/CMakeLists.txt
> @@ -27,7 +27,8 @@ macro(BuildTestBCLib file_ext)
> VERBATIM
> )
>
> - BuildTestCLib(${LIB_NAME} ${EXT_SOURCE})
> + get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> + BuildTestCLib(${LIB_NAME} ${EXT_SOURCE} ${test_name}.test.lua)
> add_dependencies(${LIB_NAME} export_bc_${file_ext})
> endmacro()
>
> diff --git a/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt b/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt
> index 3fed6105..31c9fa3b 100644
> --- a/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-601-fix-gc-finderrfunc/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libmixcframe mixcframe.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libmixcframe mixcframe.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt b/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt
> index 564b688b..1161017d 100644
> --- a/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-727-lightuserdata-itern/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(lightuserdata lightuserdata.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(lightuserdata lightuserdata.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt b/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt
> index 25520a1a..39c7532a 100644
> --- a/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-802-panic-at-mcode-protfail/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(mymprotect mymprotect.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(mymprotect mymprotect.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt b/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt
> index 16f1aa8f..7dfea075 100644
> --- a/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt
> +++ b/test/tarantool-tests/lj-flush-on-trace/CMakeLists.txt
> @@ -1 +1,2 @@
> -BuildTestCLib(libflush libflush.c)
> +get_filename_component(test_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
> +BuildTestCLib(libflush libflush.c ${test_name}.test.lua)
> diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
> index ce616fcf..bf980c7d 100644
> --- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
> +++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/both/CMakeLists.txt
> @@ -1,5 +1,7 @@
> if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
> - BuildTestCLib(resboth resboth.c)
> + BuildTestCLib(resboth resboth.c
> + profilers/gh-5813-resolving-of-c-symbols.test.lua
> + )
> # Unfortunately, <target_link_options> command is introduced
> # since CMake 3.13, so we can't use it now considering ancient
> # distros support. Just build linker flags by hands.
> diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
> index 1179601b..b80129a3 100644
> --- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
> +++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/gnuhash/CMakeLists.txt
> @@ -1,5 +1,7 @@
> if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
> - BuildTestCLib(resgnuhash resgnuhash.c)
> + BuildTestCLib(resgnuhash resgnuhash.c
> + profilers/gh-5813-resolving-of-c-symbols.test.lua
> + )
> # Unfortunately, <target_link_options> command is introduced
> # since CMake 3.13, so we can't use it now considering ancient
> # distros support. Just build linker flags by hands.
> diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
> index e0ad5675..0633f1f3 100644
> --- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
> +++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/hash/CMakeLists.txt
> @@ -1,5 +1,7 @@
> if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
> - BuildTestCLib(reshash reshash.c)
> + BuildTestCLib(reshash reshash.c
> + profilers/gh-5813-resolving-of-c-symbols.test.lua
> + )
> # Unfortunately, <target_link_options> command is introduced
> # since CMake 3.13, so we can't use it now considering ancient
> # distros support. Just build linker flags by hands.
> diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
> index 243902be..2ea0b4ac 100644
> --- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
> +++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols/stripped/CMakeLists.txt
> @@ -1,5 +1,7 @@
> if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
> - BuildTestCLib(resstripped resstripped.c)
> + BuildTestCLib(resstripped resstripped.c
> + profilers/gh-5813-resolving-of-c-symbols.test.lua
> + )
> # Unfortunately, <target_link_options> command is introduced
> # since CMake 3.13, so we can't use it now considering ancient
> # distros support. Just build linker flags by hands.
[-- Attachment #2: Type: text/html, Size: 19565 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump Sergey Kaplun via Tarantool-patches
@ 2024-09-24 11:26 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 11:45 ` Sergey Kaplun via Tarantool-patches
2024-10-11 18:38 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 11:26 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 11205 bytes --]
Hi, Sergey,
test statuses from TAP report produced by tests is not propagated to CTest.
I propose to disable these tests in CTest:
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -166,3 +167,14 @@ if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL
"GNU")
LD_PRELOAD ${LIB_ASAN}
)
endif()
+
+set_tests_properties(
+ test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
+ test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
+ test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
+
test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
+
test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
+ test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
+ test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
+ PROPERTIES DISABLED TRUE
+)
CTest will always report that these tests are disabled and we will never
forget to enable them back:
100% tests passed, 0 tests failed out of 158
Label Time Summary:
tarantool-tests = 14.66 sec*proc (165 tests)
Total Test time (real) = 14.73 sec
The following tests did not run:
222 -
test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua (Disabled)
223 -
test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
(Disabled)
224 -
test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
(Disabled)
225 -
test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
(Disabled)
226 -
test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
(Disabled)
227 -
test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua (Disabled)
228 -
test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua (Disabled)
What do you think?
On 24.09.2024 13:29, Sergey Kaplun wrote:
> Profilers tests with LUAJIT_ENABLE_TABLE_BUMP are flaky due to the bug
> in the TDUP patching. Disable them for now.
> ---
> test/tarantool-tests/CMakeLists.txt | 6 ++++++
> .../profilers/gh-5688-tool-cli-flag.test.lua | 2 ++
> .../gh-5813-resolving-of-c-symbols.test.lua | 2 ++
> .../gh-5994-memprof-human-readable.test.lua | 2 ++
> ...7264-add-proto-trace-sysprof-default.test.lua | 2 ++
> ...-9217-profile-parsers-error-handling.test.lua | 2 ++
> .../profilers/misclib-memprof-lapi.test.lua | 16 +++++++++-------
> .../profilers/misclib-sysprof-lapi.test.lua | 2 ++
> 8 files changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index d0964aed..a1aee3a2 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -97,6 +97,12 @@ if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
> list(APPEND LUA_TEST_ENV_MORE LD_PRELOAD=${LIB_ASAN})
> endif()
>
> +# FIXME: This is needed for disabling some flaky tests (like
> +# profilers), until LuaJIT/LuaJIT#606 will not be resolved.
> +if(LUAJIT_ENABLE_TABLE_BUMP)
> + list(APPEND LUA_TEST_ENV_MORE LUAJIT_TABLE_BUMP=1)
> +endif()
> +
> set(TEST_SUITE_NAME "tarantool-tests")
>
> # XXX: The call produces both test and target
> diff --git a/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua b/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
> index dd0fd260..f935dc5b 100644
> --- a/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
> +++ b/test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
> @@ -5,6 +5,8 @@ local test = tap.test('gh-5688-tool-cli-flag'):skipcond({
> ['Profile tools are implemented for Linux only'] = jit.os ~= 'Linux',
> -- XXX: Tarantool integration is required to run this test properly.
> ['No profile tools CLI option integration'] = _TARANTOOL,
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
> })
>
> test:plan(3)
> diff --git a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
> index 1581ee4b..74bcd9e8 100644
> --- a/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
> +++ b/test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
> @@ -3,6 +3,8 @@ local test = tap.test("gh-5813-resolving-of-c-symbols"):skipcond({
> ["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
> jit.arch ~= "x64",
> ["Memprof is implemented for Linux only"] = jit.os ~= "Linux",
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
> })
>
> test:plan(5)
> diff --git a/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
> index 7c3ff94d..f3041779 100644
> --- a/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
> +++ b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
> @@ -5,6 +5,8 @@ local test = tap.test('gh-5994-memprof-human-readable'):skipcond({
> ['Profile tools are implemented for Linux only'] = jit.os ~= 'Linux',
> -- XXX: Tarantool integration is required to run this test properly.
> ['No profile tools CLI option integration'] = _TARANTOOL,
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
> })
>
> local utils = require('utils')
> diff --git a/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua b/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
> index c1d68e3c..176c1a15 100644
> --- a/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
> +++ b/test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
> @@ -4,6 +4,8 @@ local test = tap.test('gh-7264-add-proto-trace-sysprof-default'):skipcond({
> ['Sysprof is implemented for x86_64 only'] = jit.arch ~= 'x86' and
> jit.arch ~= 'x64',
> ['Sysprof is implemented for Linux only'] = jit.os ~= 'Linux',
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
> })
>
> test:plan(2)
> diff --git a/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua b/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
> index 92f9f59d..65c51198 100644
> --- a/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
> +++ b/test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
> @@ -5,6 +5,8 @@ local test = tap.test('gh-9217-profile-parsers-error-handling'):skipcond({
> ['Profile tools are implemented for Linux only'] = jit.os ~= 'Linux',
> -- XXX: Tarantool integration is required to run this test properly.
> ['No profile tools CLI option integration'] = _TARANTOOL,
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
> })
>
> jit.off()
> diff --git a/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
> index 728a7ab7..ce41e4d5 100644
> --- a/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
> +++ b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
> @@ -6,6 +6,8 @@ local test = tap.test("misc-memprof-lapi"):skipcond({
> ['Disabled on *BSD due to #4819'] = jit.os == 'BSD',
> ["Memprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
> jit.arch ~= "x64",
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
> })
>
> test:plan(5)
> @@ -162,9 +164,9 @@ test:test("output", function(subtest)
> -- one is the number of allocations. 1 event - allocation of
> -- table by itself + 1 allocation of array part as far it is
> -- bigger than LJ_MAX_COLOSIZE (16).
> - subtest:ok(check_alloc_report(alloc, { line = 37, linedefined = 35 }, 2))
> + subtest:ok(check_alloc_report(alloc, { line = 39, linedefined = 37 }, 2))
> -- 20 strings allocations.
> - subtest:ok(check_alloc_report(alloc, { line = 42, linedefined = 35 }, 20))
> + subtest:ok(check_alloc_report(alloc, { line = 44, linedefined = 37 }, 20))
>
> -- Collect all previous allocated objects.
> subtest:ok(free.INTERNAL == 22)
> @@ -172,8 +174,8 @@ test:test("output", function(subtest)
> -- Tests for leak-only option.
> -- See alsohttps://github.com/tarantool/tarantool/issues/5812.
> local heap_delta = process.form_heap_delta(events)
> - local tab_alloc_stats = heap_delta[form_source_line(37)]
> - local str_alloc_stats = heap_delta[form_source_line(42)]
> + local tab_alloc_stats = heap_delta[form_source_line(39)]
> + local str_alloc_stats = heap_delta[form_source_line(44)]
> subtest:ok(tab_alloc_stats.nalloc == tab_alloc_stats.nfree)
> subtest:ok(tab_alloc_stats.dbytes == 0)
> subtest:ok(str_alloc_stats.nalloc == str_alloc_stats.nfree)
> @@ -258,10 +260,10 @@ test:test("jit-output", function(subtest)
> -- 10 allocations in interpreter mode, 1 allocation for a trace
> -- recording and assembling and next 9 allocations will happen
> -- while running the trace.
> - subtest:ok(check_alloc_report(alloc, { line = 42, linedefined = 35 }, 11))
> - subtest:ok(check_alloc_report(alloc, { traceno = 1, line = 40 }, 9))
> + subtest:ok(check_alloc_report(alloc, { line = 44, linedefined = 37 }, 11))
> + subtest:ok(check_alloc_report(alloc, { traceno = 1, line = 42 }, 9))
> -- See same checks with jit.off().
> - subtest:ok(check_alloc_report(alloc, { line = 37, linedefined = 35 }, 2))
> + subtest:ok(check_alloc_report(alloc, { line = 39, linedefined = 37 }, 2))
>
> -- Restore default JIT settings.
> jit.opt.start(unpack(jit_opt_default))
> diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
> index fdaed46a..26c277cd 100644
> --- a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
> +++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
> @@ -3,6 +3,8 @@ local test = tap.test("misc-sysprof-lapi"):skipcond({
> ["Sysprof is implemented for x86_64 only"] = jit.arch ~= "x86" and
> jit.arch ~= "x64",
> ["Sysprof is implemented for Linux only"] = jit.os ~= "Linux",
> + -- See alsohttps://github.com/LuaJIT/LuaJIT/issues/606.
> + ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
> })
>
> test:plan(19)
[-- Attachment #2: Type: text/html, Size: 12579 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
2024-09-24 11:16 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-24 11:28 ` Sergey Kaplun via Tarantool-patches
2024-09-24 14:18 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 11:28 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Fixed your comment and force-pushed the branch.
On 24.09.24, Sergey Bronnikov wrote:
> Hi, Sergey,
>
> thanks for the updated patch!
>
> I'm happy to see how much code was removed.
>
> See my comments below.
>
> On 24.09.2024 13:29, Sergey Kaplun wrote:
> > This patch sets the unique value of each of these variables for each of
> > the tests and only where they are needed. Also, it drops the comment
> > about SIP [1] tricks since it is obsolete after
> > 29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
> > utils.selfrun in tests").
> >
> > [1]:https://support.apple.com/en-us/HT204899
> >
> > Resolves tarantool/tarantool#9898
> > ---
<snipped>
> > +
> > + if(LIBS_${test_name})
> > + foreach(path ${LIBS_${test_name}})
> > + # Add the directory where the library is built to the list
> > + # with entries for the LUA_CPATH environment variable, so
> > + # LuaJIT can find and load it.
> > + AppendTestEnvVar(${test_title}
> > + LUA_CPATH "${path}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;"
> > + )
> > + # Also, add this directory to the LD_LIBRARY_PATH environment
> > + # variable so FFI machinery can find and load it.
> > + # XXX: Be noticed that we shouldn't use `"` here to wrap the
> > + # variable's content. If we do this, the variable value will
> > + # contain `"` at the beginning and the end, so this `"` at the
> > + # beginning will be treated as the directory for the entry.
> > + # XXX: Since the auxiliary libraries are built as dynamically
> > + # loaded modules on MacOS instead of shared libraries as it is
> > + # done on Linux and BSD, another environment variable should
> > + # be used to guide <ffi.load> while searching the extension.
> > + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
> > + AppendTestEnvVar(${test_title} DYLD_LIBRARY_PATH ${path}:)
> > + else()
> > + AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
> > + endif()
> please add unset(LIBS_${test_name})
===================================================================
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 74086ca4..297d5801 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -146,6 +146,8 @@ foreach(test_path ${tests})
AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
endif()
endforeach()
+
+ unset(LIBS_${test_name})
endif()
endforeach()
===================================================================
> > + endforeach()
<snipped>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable
2024-09-24 11:15 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-24 11:33 ` Sergey Kaplun via Tarantool-patches
[not found] ` <ZvO5g6ryIcyhM1vg@root>
0 siblings, 1 reply; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 11:33 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
On 24.09.24, Sergey Bronnikov wrote:
> Hi, Sergey,
>
>
> On 24.09.2024 13:29, Sergey Kaplun wrote:
> > This patch removes the default adding of the tools directory to the
> > LUA_PATH. Now it is done only for profilers tests.
> >
> > Part of tarantool/tarantool#9898
> > ---
<snipped>
> > @@ -163,4 +161,12 @@ foreach(test_path ${tests})
> > LABELS ${TEST_SUITE_NAME}
> > DEPENDS tarantool-tests-deps
> > )
> > +
> > + # The part of the profilers toolchain is located in the <tools/>
> > + # directory, so LUA_PATH needs to be updated.
> > + if(test_name MATCHES "^profilers")
> > + AppendTestEnvVar(${test_title}
> > + LUA_PATH "${PROJECT_SOURCE_DIR}/tools/?.lua\;"
> > + )
> > + endif()
> > endforeach()
>
> AFAIR, we decided to move the last hunk to profilers/CMakeLists.txt.
I don't remember that, unfortunately. Also, may be it is better that
this cycle handles all tests? Otherwise, we should scan that directory
again with constructing test_title again. This is why we decided to move
it in the cycle instead of the child <CMakeLists.txt> [1].
>
[1]: https://lists.tarantool.org/tarantool-patches/c22c7bc2-ddaa-4b22-83ae-edba3ce73dd6@tarantool.org/T/#u
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump
2024-09-24 11:26 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-24 11:45 ` Sergey Kaplun via Tarantool-patches
2024-09-24 14:17 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 11:45 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
On 24.09.24, Sergey Bronnikov wrote:
> Hi, Sergey,
>
> test statuses from TAP report produced by tests is not propagated to CTest.
>
> I propose to disable these tests in CTest:
>
>
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -166,3 +167,14 @@ if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL
> "GNU")
> LD_PRELOAD ${LIB_ASAN}
> )
> endif()
> +
> +set_tests_properties(
> + test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
> + test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
> + test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
> +
> test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
> +
> test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
> + test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
> + test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
> + PROPERTIES DISABLED TRUE
> +)
>
>
> CTest will always report that these tests are disabled and we will never
> forget to enable them back:
>
>
> 100% tests passed, 0 tests failed out of 158
>
> Label Time Summary:
> tarantool-tests = 14.66 sec*proc (165 tests)
>
> Total Test time (real) = 14.73 sec
>
> The following tests did not run:
> 222 -
> test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua (Disabled)
> 223 -
> test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
> (Disabled)
> 224 -
> test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
> (Disabled)
> 225 -
> test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
> (Disabled)
> 226 -
> test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
> (Disabled)
> 227 -
> test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua (Disabled)
> 228 -
> test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua (Disabled)
>
>
> What do you think?
>
Side note: this is new in 3.9, so we need to update CMake first.
I'm not sure about this one.
We also have all skipconditions inside the test itself, which makes it
"self-sufficient" -- so if we look at the test, we know all builds when
it is disabled. Adding another location may be confusing.
OTOH, we can see skipped tests in -V mode (but I agree, that it isn't
very convenient).
I am open for discussion :).
>
> On 24.09.2024 13:29, Sergey Kaplun wrote:
> > Profilers tests with LUAJIT_ENABLE_TABLE_BUMP are flaky due to the bug
> > in the TDUP patching. Disable them for now.
> > ---
> > test/tarantool-tests/CMakeLists.txt | 6 ++++++
> > .../profilers/gh-5688-tool-cli-flag.test.lua | 2 ++
> > .../gh-5813-resolving-of-c-symbols.test.lua | 2 ++
> > .../gh-5994-memprof-human-readable.test.lua | 2 ++
> > ...7264-add-proto-trace-sysprof-default.test.lua | 2 ++
> > ...-9217-profile-parsers-error-handling.test.lua | 2 ++
> > .../profilers/misclib-memprof-lapi.test.lua | 16 +++++++++-------
> > .../profilers/misclib-sysprof-lapi.test.lua | 2 ++
> > 8 files changed, 27 insertions(+), 7 deletions(-)
> >
> > diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
<snipped>
> > test:plan(19)
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary Sergey Kaplun via Tarantool-patches
@ 2024-09-24 14:13 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 15:23 ` Sergey Kaplun via Tarantool-patches
2024-10-11 18:46 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 1 reply; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 14:13 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2590 bytes --]
Hi, Sergey,
On 24.09.2024 13:29, Sergey Kaplun wrote:
> This patch sets LD_PRELOAD for ASan build for the required tests instead
> of all tests.
>
> Follows up tarantool/tarantool#9898
probably follows up these commits as well:
commit 9f1137bcc890c28c5de24497624553574d371007 "cmake: replace prove
with CTest"
commit abe1e0aca3ad01f89f9d184c2a82949314814d04 "ci: execute LuaJIT
tests with GCC 10 and ASAN"
LGTM
> ---
> test/tarantool-tests/CMakeLists.txt | 33 ++++++++++++++++-------------
> 1 file changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index a1aee3a2..74086ca4 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -82,21 +82,6 @@ make_lua_path(LUA_PATH
>
> set(LUA_TEST_SUFFIX .test.lua)
>
> -# Some tests use `LD_PRELOAD` to mock system calls (like
> -# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
> -# `mprotect()`. When compiling with ASan support under GCC, it is
> -# required that the ASan library go first in the `LD_PRELOAD`
> -# list. Set it manually. The test will append it to the executed
> -# process.
> -if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
> - # FIXME: We should set this environment variable only
> - # for the corresponding tests to avoid warnings from
> - # the GNU libc and other libc implementations.
> - # Seehttps://github.com/tarantool/tarantool/issues/9898.
> - LibRealPath(LIB_ASAN libasan.so)
> - list(APPEND LUA_TEST_ENV_MORE LD_PRELOAD=${LIB_ASAN})
> -endif()
> -
> # FIXME: This is needed for disabling some flaky tests (like
> # profilers), until LuaJIT/LuaJIT#606 will not be resolved.
> if(LUAJIT_ENABLE_TABLE_BUMP)
> @@ -163,3 +148,21 @@ foreach(test_path ${tests})
> endforeach()
> endif()
> endforeach()
> +
> +# Some tests use `LD_PRELOAD` to mock system calls (like
> +# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
> +# `mprotect()`). When compiling with ASan support under GCC, it is
> +# required that the ASan library go first in the `LD_PRELOAD`
> +# list. Set it manually. The test will append it to the executed
> +# process.
> +if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
> + LibRealPath(LIB_ASAN libasan.so)
> + AppendTestEnvVar(
> + "test/${TEST_SUITE_NAME}/lj-522-fix-dlerror-return-null.test.lua"
> + LD_PRELOAD ${LIB_ASAN}
> + )
> + AppendTestEnvVar(
> + "test/${TEST_SUITE_NAME}/lj-802-panic-at-mcode-protfail.test.lua"
> + LD_PRELOAD ${LIB_ASAN}
> + )
> +endif()
[-- Attachment #2: Type: text/html, Size: 3362 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump
2024-09-24 11:45 ` Sergey Kaplun via Tarantool-patches
@ 2024-09-24 14:17 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 14:17 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 3752 bytes --]
Hi, Sergey,
On 24.09.2024 14:45, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
>
> On 24.09.24, Sergey Bronnikov wrote:
>> Hi, Sergey,
>>
>> test statuses from TAP report produced by tests is not propagated to CTest.
>>
>> I propose to disable these tests in CTest:
>>
>>
>> --- a/test/tarantool-tests/CMakeLists.txt
>> +++ b/test/tarantool-tests/CMakeLists.txt
>> @@ -166,3 +167,14 @@ if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL
>> "GNU")
>> LD_PRELOAD ${LIB_ASAN}
>> )
>> endif()
>> +
>> +set_tests_properties(
>> + test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua
>> + test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
>> + test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
>> +
>> test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
>> +
>> test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
>> + test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
>> + test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
>> + PROPERTIES DISABLED TRUE
>> +)
>>
>>
>> CTest will always report that these tests are disabled and we will never
>> forget to enable them back:
>>
>>
>> 100% tests passed, 0 tests failed out of 158
>>
>> Label Time Summary:
>> tarantool-tests = 14.66 sec*proc (165 tests)
>>
>> Total Test time (real) = 14.73 sec
>>
>> The following tests did not run:
>> 222 -
>> test/tarantool-tests/profilers/gh-5688-tool-cli-flag.test.lua (Disabled)
>> 223 -
>> test/tarantool-tests/profilers/gh-5813-resolving-of-c-symbols.test.lua
>> (Disabled)
>> 224 -
>> test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
>> (Disabled)
>> 225 -
>> test/tarantool-tests/profilers/gh-7264-add-proto-trace-sysprof-default.test.lua
>> (Disabled)
>> 226 -
>> test/tarantool-tests/profilers/gh-9217-profile-parsers-error-handling.test.lua
>> (Disabled)
>> 227 -
>> test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua (Disabled)
>> 228 -
>> test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua (Disabled)
>>
>>
>> What do you think?
>>
> Side note: this is new in 3.9, so we need to update CMake first.
>
> I'm not sure about this one.
> We also have all skipconditions inside the test itself, which makes it
> "self-sufficient" -- so if we look at the test, we know all builds when
> it is disabled. Adding another location may be confusing.
I agree. The ideal option for us is when TAP statuses are propagated to
CTest,
but it is not an option now.
>
> OTOH, we can see skipped tests in -V mode (but I agree, that it isn't
> very convenient).
>
> I am open for discussion :).
Feel free to ignore, I'll not insist.
LGTM
>> On 24.09.2024 13:29, Sergey Kaplun wrote:
>>> Profilers tests with LUAJIT_ENABLE_TABLE_BUMP are flaky due to the bug
>>> in the TDUP patching. Disable them for now.
>>> ---
>>> test/tarantool-tests/CMakeLists.txt | 6 ++++++
>>> .../profilers/gh-5688-tool-cli-flag.test.lua | 2 ++
>>> .../gh-5813-resolving-of-c-symbols.test.lua | 2 ++
>>> .../gh-5994-memprof-human-readable.test.lua | 2 ++
>>> ...7264-add-proto-trace-sysprof-default.test.lua | 2 ++
>>> ...-9217-profile-parsers-error-handling.test.lua | 2 ++
>>> .../profilers/misclib-memprof-lapi.test.lua | 16 +++++++++-------
>>> .../profilers/misclib-sysprof-lapi.test.lua | 2 ++
>>> 8 files changed, 27 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> <snipped>
>
>>> test:plan(19)
[-- Attachment #2: Type: text/html, Size: 4869 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
2024-09-24 11:28 ` Sergey Kaplun via Tarantool-patches
@ 2024-09-24 14:18 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 14:18 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 2760 bytes --]
Thanks, LGTM.
On 24.09.2024 14:28, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Fixed your comment and force-pushed the branch.
>
> On 24.09.24, Sergey Bronnikov wrote:
>> Hi, Sergey,
>>
>> thanks for the updated patch!
>>
>> I'm happy to see how much code was removed.
>>
>> See my comments below.
>>
>> On 24.09.2024 13:29, Sergey Kaplun wrote:
>>> This patch sets the unique value of each of these variables for each of
>>> the tests and only where they are needed. Also, it drops the comment
>>> about SIP [1] tricks since it is obsolete after
>>> 29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
>>> utils.selfrun in tests").
>>>
>>> [1]:https://support.apple.com/en-us/HT204899
>>>
>>> Resolves tarantool/tarantool#9898
>>> ---
> <snipped>
>
>>> +
>>> + if(LIBS_${test_name})
>>> + foreach(path ${LIBS_${test_name}})
>>> + # Add the directory where the library is built to the list
>>> + # with entries for the LUA_CPATH environment variable, so
>>> + # LuaJIT can find and load it.
>>> + AppendTestEnvVar(${test_title}
>>> + LUA_CPATH "${path}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;"
>>> + )
>>> + # Also, add this directory to the LD_LIBRARY_PATH environment
>>> + # variable so FFI machinery can find and load it.
>>> + # XXX: Be noticed that we shouldn't use `"` here to wrap the
>>> + # variable's content. If we do this, the variable value will
>>> + # contain `"` at the beginning and the end, so this `"` at the
>>> + # beginning will be treated as the directory for the entry.
>>> + # XXX: Since the auxiliary libraries are built as dynamically
>>> + # loaded modules on MacOS instead of shared libraries as it is
>>> + # done on Linux and BSD, another environment variable should
>>> + # be used to guide <ffi.load> while searching the extension.
>>> + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
>>> + AppendTestEnvVar(${test_title} DYLD_LIBRARY_PATH ${path}:)
>>> + else()
>>> + AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
>>> + endif()
>> please add unset(LIBS_${test_name})
> ===================================================================
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index 74086ca4..297d5801 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -146,6 +146,8 @@ foreach(test_path ${tests})
> AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
> endif()
> endforeach()
> +
> + unset(LIBS_${test_name})
> endif()
> endforeach()
>
> ===================================================================
>
>>> + endforeach()
> <snipped>
>
[-- Attachment #2: Type: text/html, Size: 3797 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary
2024-09-24 14:13 ` Sergey Bronnikov via Tarantool-patches
@ 2024-09-24 15:23 ` Sergey Kaplun via Tarantool-patches
2024-09-24 17:41 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-09-24 15:23 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the review!
Fixed your comment and force-pushed the branch.
On 24.09.24, Sergey Bronnikov wrote:
> Hi, Sergey,
>
> On 24.09.2024 13:29, Sergey Kaplun wrote:
> > This patch sets LD_PRELOAD for ASan build for the required tests instead
> > of all tests.
> >
> > Follows up tarantool/tarantool#9898
>
> probably follows up these commits as well:
>
>
> commit 9f1137bcc890c28c5de24497624553574d371007 "cmake: replace prove
> with CTest"
>
> commit abe1e0aca3ad01f89f9d184c2a82949314814d04 "ci: execute LuaJIT
> tests with GCC 10 and ASAN"
I've opted the previous commit (where the corresponding FIXME is
introduced). The new commit message is:
| test: set LD_PRELOAD only when necessary
|
| As a follow-up for 888adcfb72e361b150a9038407eb1dc9bd3392bd ("test: fix
| lj-802-panic-at-mcode-protfail GCC+ASan"), this patch sets LD_PRELOAD
| for ASan build for the required tests instead of all tests.
|
| Follows up tarantool/tarantool#9898
>
> LGTM
>
> > ---
<snipped>
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary
2024-09-24 15:23 ` Sergey Kaplun via Tarantool-patches
@ 2024-09-24 17:41 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-24 17:41 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]
On 24.09.2024 18:23, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
> Fixed your comment and force-pushed the branch.
>
> On 24.09.24, Sergey Bronnikov wrote:
>> Hi, Sergey,
>>
>> On 24.09.2024 13:29, Sergey Kaplun wrote:
>>> This patch sets LD_PRELOAD for ASan build for the required tests instead
>>> of all tests.
>>>
>>> Follows up tarantool/tarantool#9898
>> probably follows up these commits as well:
>>
>>
>> commit 9f1137bcc890c28c5de24497624553574d371007 "cmake: replace prove
>> with CTest"
>>
>> commit abe1e0aca3ad01f89f9d184c2a82949314814d04 "ci: execute LuaJIT
>> tests with GCC 10 and ASAN"
> I've opted the previous commit (where the corresponding FIXME is
> introduced). The new commit message is:
>
> | test: set LD_PRELOAD only when necessary
> |
> | As a follow-up for 888adcfb72e361b150a9038407eb1dc9bd3392bd ("test: fix
> | lj-802-panic-at-mcode-protfail GCC+ASan"), this patch sets LD_PRELOAD
> | for ASan build for the required tests instead of all tests.
> |
> | Follows up tarantool/tarantool#9898
Thanks! LGTM
>
>
>> LGTM
>>
>>> ---
> <snipped>
>
[-- Attachment #2: Type: text/html, Size: 2154 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable
[not found] ` <ZvO5g6ryIcyhM1vg@root>
@ 2024-09-25 7:22 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 32+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-09-25 7:22 UTC (permalink / raw)
To: Sergey Kaplun, Maxim Kokryashkin; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]
Hi, Sergey,
On 25.09.2024 10:19, Sergey Kaplun wrote:
> On 24.09.24, Sergey Kaplun via Tarantool-patches wrote:
>> Hi, Sergey!
>>
>> On 24.09.24, Sergey Bronnikov wrote:
>>> Hi, Sergey,
>>>
>>>
>>> On 24.09.2024 13:29, Sergey Kaplun wrote:
>>>> This patch removes the default adding of the tools directory to the
>>>> LUA_PATH. Now it is done only for profilers tests.
>>>>
>>>> Part of tarantool/tarantool#9898
>>>> ---
>> <snipped>
>>
>>>> @@ -163,4 +161,12 @@ foreach(test_path ${tests})
>>>> LABELS ${TEST_SUITE_NAME}
>>>> DEPENDS tarantool-tests-deps
>>>> )
>>>> +
>>>> + # The part of the profilers toolchain is located in the <tools/>
>>>> + # directory, so LUA_PATH needs to be updated.
>>>> + if(test_name MATCHES "^profilers")
>>>> + AppendTestEnvVar(${test_title}
>>>> + LUA_PATH "${PROJECT_SOURCE_DIR}/tools/?.lua\;"
>>>> + )
>>>> + endif()
>>>> endforeach()
>>> AFAIR, we decided to move the last hunk to profilers/CMakeLists.txt.
>> I don't remember that, unfortunately. Also, may be it is better that
>> this cycle handles all tests? Otherwise, we should scan that directory
>> again with constructing test_title again. This is why we decided to move
>> it in the cycle instead of the child <CMakeLists.txt> [1].
>>
Okay, let's leave it without changes.
LGTM
>> [1]:https://lists.tarantool.org/tarantool-patches/c22c7bc2-ddaa-4b22-83ae-edba3ce73dd6@tarantool.org/T/#u
>>
>> --
>> Best regards,
>> Sergey Kaplun
[-- Attachment #2: Type: text/html, Size: 2939 bytes --]
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:28 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:28 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua>
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua> Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:29 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:29 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:30 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:30 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable Sergey Kaplun via Tarantool-patches
2024-09-24 11:15 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:31 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:31 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH Sergey Kaplun via Tarantool-patches
2024-09-24 11:16 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:37 ` Maxim Kokryashkin via Tarantool-patches
2024-10-12 7:00 ` Sergey Kaplun via Tarantool-patches
1 sibling, 1 reply; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:37 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM, except for a single nit below.
On Tue, Sep 24, 2024 at 01:29:50PM GMT, Sergey Kaplun wrote:
> This patch sets the unique value of each of these variables for each of
> the tests and only where they are needed. Also, it drops the comment
> about SIP [1] tricks since it is obsolete after
> 29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
> utils.selfrun in tests").
>
> [1]: https://support.apple.com/en-us/HT204899
>
> Resolves tarantool/tarantool#9898
> ---
> test/tarantool-tests/CMakeLists.txt | 85 ++++++++-----------
> test/tarantool-tests/ffi-ccall/CMakeLists.txt | 2 +-
> .../fix-bit-shift-generation/CMakeLists.txt | 3 +-
> .../gh-4427-ffi-sandwich/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../gh-6189-cur_L/CMakeLists.txt | 3 +-
> .../lj-1004-oom-error-frame/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-1166-error-stitch/CMakeLists.txt | 6 +-
> .../lj-416-xor-before-jcc/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-549-bytecode-loader/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-601-fix-gc-finderrfunc/CMakeLists.txt | 3 +-
> .../lj-727-lightuserdata-itern/CMakeLists.txt | 3 +-
> .../CMakeLists.txt | 3 +-
> .../lj-flush-on-trace/CMakeLists.txt | 3 +-
> .../both/CMakeLists.txt | 4 +-
> .../gnuhash/CMakeLists.txt | 4 +-
> .../hash/CMakeLists.txt | 4 +-
> .../stripped/CMakeLists.txt | 4 +-
> 21 files changed, 82 insertions(+), 69 deletions(-)
>
> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> index 5e3493b6..d0964aed 100644
> --- a/test/tarantool-tests/CMakeLists.txt
> +++ b/test/tarantool-tests/CMakeLists.txt
> @@ -5,17 +5,16 @@ add_custom_target(tarantool-tests-libs
> DEPENDS libluajit
> )
>
> -macro(BuildTestCLib lib sources)
> - AddTestLib(${lib} ${sources})
> +macro(BuildTestCLib lib source for_tests)
This whole macro signature now reads something like `lib source
for_tests` which looks kind of misleading, especially in the code below.
IMO, it would be better to call the last variable like `dependent_tests`
for better readability. Feel free to ignore, though.
--
> 2.46.0
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump Sergey Kaplun via Tarantool-patches
2024-09-24 11:26 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:38 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:38 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary Sergey Kaplun via Tarantool-patches
2024-09-24 14:13 ` Sergey Bronnikov via Tarantool-patches
@ 2024-10-11 18:46 ` Maxim Kokryashkin via Tarantool-patches
1 sibling, 0 replies; 32+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-10-11 18:46 UTC (permalink / raw)
To: Sergey Kaplun; +Cc: tarantool-patches
Hi, Sergey!
Thanks for the patch!
LGTM
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
2024-10-11 18:37 ` Maxim Kokryashkin via Tarantool-patches
@ 2024-10-12 7:00 ` Sergey Kaplun via Tarantool-patches
0 siblings, 0 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-10-12 7:00 UTC (permalink / raw)
To: Maxim Kokryashkin; +Cc: tarantool-patches
Hi, Maxim!
Thanks for the review!
Fixed your comment and force-pushed the branch.
On 11.10.24, Maxim Kokryashkin wrote:
> Hi, Sergey!
> Thanks for the patch!
> LGTM, except for a single nit below.
>
> On Tue, Sep 24, 2024 at 01:29:50PM GMT, Sergey Kaplun wrote:
> > This patch sets the unique value of each of these variables for each of
> > the tests and only where they are needed. Also, it drops the comment
> > about SIP [1] tricks since it is obsolete after
> > 29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
> > utils.selfrun in tests").
> >
> > [1]: https://support.apple.com/en-us/HT204899
> >
> > Resolves tarantool/tarantool#9898
> > ---
> > test/tarantool-tests/CMakeLists.txt | 85 ++++++++-----------
> > test/tarantool-tests/ffi-ccall/CMakeLists.txt | 2 +-
> > .../fix-bit-shift-generation/CMakeLists.txt | 3 +-
> > .../gh-4427-ffi-sandwich/CMakeLists.txt | 3 +-
> > .../CMakeLists.txt | 3 +-
> > .../gh-6189-cur_L/CMakeLists.txt | 3 +-
> > .../lj-1004-oom-error-frame/CMakeLists.txt | 3 +-
> > .../CMakeLists.txt | 3 +-
> > .../lj-1166-error-stitch/CMakeLists.txt | 6 +-
> > .../lj-416-xor-before-jcc/CMakeLists.txt | 3 +-
> > .../CMakeLists.txt | 3 +-
> > .../lj-549-bytecode-loader/CMakeLists.txt | 3 +-
> > .../CMakeLists.txt | 3 +-
> > .../lj-601-fix-gc-finderrfunc/CMakeLists.txt | 3 +-
> > .../lj-727-lightuserdata-itern/CMakeLists.txt | 3 +-
> > .../CMakeLists.txt | 3 +-
> > .../lj-flush-on-trace/CMakeLists.txt | 3 +-
> > .../both/CMakeLists.txt | 4 +-
> > .../gnuhash/CMakeLists.txt | 4 +-
> > .../hash/CMakeLists.txt | 4 +-
> > .../stripped/CMakeLists.txt | 4 +-
> > 21 files changed, 82 insertions(+), 69 deletions(-)
> >
> > diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
> > index 5e3493b6..d0964aed 100644
> > --- a/test/tarantool-tests/CMakeLists.txt
> > +++ b/test/tarantool-tests/CMakeLists.txt
> > @@ -5,17 +5,16 @@ add_custom_target(tarantool-tests-libs
> > DEPENDS libluajit
> > )
> >
> > -macro(BuildTestCLib lib sources)
> > - AddTestLib(${lib} ${sources})
> > +macro(BuildTestCLib lib source for_tests)
>
> This whole macro signature now reads something like `lib source
> for_tests` which looks kind of misleading, especially in the code below.
>
> IMO, it would be better to call the last variable like `dependent_tests`
> for better readability. Feel free to ignore, though.
Renamed as you suggested:
===================================================================
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 297d5801..0f9bca69 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -5,12 +5,12 @@ add_custom_target(tarantool-tests-libs
DEPENDS libluajit
)
-macro(BuildTestCLib lib source for_tests)
+macro(BuildTestCLib lib source dependent_tests)
AddTestLib(${lib} ${source})
add_dependencies(tarantool-tests-libs ${lib})
# Remember libraries for each test to be proceeded with after
# test targets are created.
- foreach(testname ${for_tests})
+ foreach(testname ${dependent_tests})
set(LIBS_${testname}
"${CMAKE_CURRENT_BINARY_DIR};${LIBS_${testname}}" PARENT_SCOPE
)
===================================================================
>
> --
> > 2.46.0
> >
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
` (6 preceding siblings ...)
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary Sergey Kaplun via Tarantool-patches
@ 2024-10-18 15:18 ` Sergey Kaplun via Tarantool-patches
7 siblings, 0 replies; 32+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2024-10-18 15:18 UTC (permalink / raw)
To: Maxim Kokryashkin, Sergey Bronnikov; +Cc: tarantool-patches
I've applied the patchset into all long-term branches in tarantool/luajit
and bumped a new version in master [1], release/3.2 [2] and
release/2.11 [3].
[1]: https://github.com/tarantool/tarantool/pull/10712
[2]: https://github.com/tarantool/tarantool/pull/10713
[3]: https://github.com/tarantool/tarantool/pull/10714
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2024-10-18 15:19 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-24 10:29 [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 1/7] test: move profilers tests to subdirectory Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:28 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 2/7] test: rename <arm64-ccall-fp-convention.test.lua> Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:29 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 3/7] cmake: introduce AppendTestEnvVar macro Sergey Kaplun via Tarantool-patches
2024-09-24 11:07 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:30 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 4/7] test: shrink LUA_PATH environment variable Sergey Kaplun via Tarantool-patches
2024-09-24 11:15 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 11:33 ` Sergey Kaplun via Tarantool-patches
[not found] ` <ZvO5g6ryIcyhM1vg@root>
2024-09-25 7:22 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:31 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH Sergey Kaplun via Tarantool-patches
2024-09-24 11:16 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 11:28 ` Sergey Kaplun via Tarantool-patches
2024-09-24 14:18 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:37 ` Maxim Kokryashkin via Tarantool-patches
2024-10-12 7:00 ` Sergey Kaplun via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 6/7] test: skip flaky tests with enabled table bump Sergey Kaplun via Tarantool-patches
2024-09-24 11:26 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 11:45 ` Sergey Kaplun via Tarantool-patches
2024-09-24 14:17 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:38 ` Maxim Kokryashkin via Tarantool-patches
2024-09-24 10:29 ` [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary Sergey Kaplun via Tarantool-patches
2024-09-24 14:13 ` Sergey Bronnikov via Tarantool-patches
2024-09-24 15:23 ` Sergey Kaplun via Tarantool-patches
2024-09-24 17:41 ` Sergey Bronnikov via Tarantool-patches
2024-10-11 18:46 ` Maxim Kokryashkin via Tarantool-patches
2024-10-18 15:18 ` [Tarantool-patches] [PATCH v2 luajit 0/7] Shrink test env and fix flaky tests Sergey Kaplun via Tarantool-patches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox