Skip to content

Commit 8111743

Browse files
ligurio0x501D
authored andcommitted
test: shuffle tests
luatest has an option --shuffle that allows to randomise the order of tests. This can be useful to detect a test that passes just because it happens to run after an unrelated test that leaves the system in a favourable state. Patch enable tests shuffling with predefined random seed generated by CMake [1]. Seed is useful for reproducing a problems related to the specific test order. 1. https://cmake.org/cmake/help/latest/command/string.html#random
1 parent f11a68f commit 8111743

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ include_directories(${TARANTOOL_INCLUDE_DIRS})
2222
# Set CFLAGS
2323
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra")
2424

25+
string(RANDOM ALPHABET 0123456789 seed)
26+
2527
add_subdirectory(http)
2628

2729
add_custom_target(luacheck
@@ -31,7 +33,7 @@ add_custom_target(luacheck
3133
)
3234

3335
add_custom_target(luatest
34-
COMMAND ${LUATEST} -v --coverage
36+
COMMAND ${LUATEST} -v --coverage --shuffle all:${seed}
3537
BYPRODUCTS ${CODE_COVERAGE_STATS}
3638
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
3739
COMMENT "Run regression tests"

0 commit comments

Comments
 (0)