Zap rocksdb storage before the test

This commit is contained in:
Yuriy Glukhov 2018-07-26 23:08:43 +03:00
parent 555dcd5a01
commit 4e2054896d
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import
unittest, macros,
unittest, macros, os,
nimcrypto/[keccak, hash], ranges, eth_common/eth_types,
../nimbus/db/[storage_types],
../nimbus/db/backends/[sqlite_backend, rocksdb_backend]
@ -8,7 +8,9 @@ template dummyInstance(T: type SqliteChainDB): auto =
sqlite_backend.initChainDB ":memory:"
template dummyInstance(T: type RocksChainDB): auto =
rocksdb_backend.initChainDB "/tmp/nimbus-test-db"
let tmp = getTempDir() / "nimbus-test-db"
removeDir(tmp)
rocksdb_backend.initChainDB(tmp)
template backendTests(DB) =
suite("storage tests: " & astToStr(DB)):