Skip to content

Commit 359a1f3

Browse files
committed
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 specified by $RANDOM. Seed is useful for reproducing a problems related to the specific test order.
1 parent 5f8f224 commit 359a1f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LUACOV_REPORT := $(PROJECT_DIR)/luacov.report.out
77
LUACOV_STATS := $(PROJECT_DIR)/luacov.stats.out
88

99
SHELL := $(shell which bash) # Required for brace expansion used in a clean target.
10+
SEED ?= $(shell /bin/bash -c "echo $$RANDOM")
1011

1112
CLEANUP_FILES = tarantool.log
1213
CLEANUP_FILES += *.index
@@ -32,7 +33,7 @@ luacheck:
3233

3334
.PHONY: test
3435
test:
35-
luatest -v --coverage
36+
luatest -v --coverage --shuffle all:${SEED}
3637
rm -rf ${CLEANUP_FILES}
3738
INDEX_TYPE='TREE' SPACE_TYPE='vinyl' ./test.lua
3839
rm -rf ${CLEANUP_FILES}

0 commit comments

Comments
 (0)