Skip to content

Commit 3547b45

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 8841477 commit 3547b45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +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")
10+
SEED ?= $(shell /bin/bash -c "echo $$RANDOM")
1111

1212
CLEANUP_FILES = tarantool.log
1313
CLEANUP_FILES += *.index
@@ -33,7 +33,7 @@ luacheck:
3333

3434
.PHONY: test
3535
test:
36-
luatest -v --coverage --shuffle all:${SEED} --seed ${SEED}
36+
luatest -v --coverage --shuffle all:${SEED}
3737
rm -rf ${CLEANUP_FILES}
3838
INDEX_TYPE='TREE' SPACE_TYPE='vinyl' ./test.lua
3939
rm -rf ${CLEANUP_FILES}

0 commit comments

Comments
 (0)