Skip to content

Commit 44214ad

Browse files
committed
Don't litter workdir when running tests
The tests are run in current workdir and call box.cfg which creates snapshots and xlog files. This patch keeps workdir clean by using the common approach: - disable xlog using `wal_mode = 'none'` - create snapshot in a temp dir and remove it immediately
1 parent e77a6cb commit 44214ad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/run_tests.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
#!/usr/bin/env tarantool
22

3-
fiber = require('fiber')
3+
local fio = require('fio')
4+
local fiber = require('fiber')
5+
6+
local tmpdir = fio.tempdir()
47

58
box.cfg{
69
listen = 3301,
10+
wal_mode = 'none',
11+
memtx_dir = tmpdir,
712
}
813

14+
fio.rmtree(tmpdir)
15+
916
-- Init test database
1017
box.once('bootstrap_tests', function()
1118
box.schema.user.create('test_user', { password = 'password' })

0 commit comments

Comments
 (0)