2022-12-03 00:00:55 +00:00
|
|
|
import std/os
|
|
|
|
import std/strutils
|
2023-03-08 15:04:54 +00:00
|
|
|
import std/sequtils
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
import pkg/questionable
|
|
|
|
import pkg/questionable/results
|
|
|
|
|
|
|
|
import pkg/chronos
|
|
|
|
import pkg/stew/byteutils
|
|
|
|
import pkg/stew/endians2
|
|
|
|
import pkg/datastore
|
|
|
|
|
|
|
|
import pkg/codex/stores/cachestore
|
|
|
|
import pkg/codex/chunker
|
|
|
|
import pkg/codex/stores
|
|
|
|
import pkg/codex/blocktype as bt
|
2023-03-08 15:04:54 +00:00
|
|
|
import pkg/codex/clock
|
2023-11-14 12:02:17 +00:00
|
|
|
import pkg/codex/utils/asynciter
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-01-29 20:03:51 +00:00
|
|
|
import ../../asynctest
|
2022-12-03 00:00:55 +00:00
|
|
|
import ../helpers
|
2023-03-08 15:04:54 +00:00
|
|
|
import ../helpers/mockclock
|
2023-08-21 02:51:04 +00:00
|
|
|
import ../examples
|
2022-12-03 00:00:55 +00:00
|
|
|
import ./commonstoretests
|
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
import ./repostore/testcoders
|
|
|
|
|
2023-06-22 18:01:21 +00:00
|
|
|
checksuite "Test RepoStore start/stop":
|
2023-03-16 15:00:36 +00:00
|
|
|
|
|
|
|
var
|
|
|
|
repoDs: Datastore
|
|
|
|
metaDs: Datastore
|
|
|
|
|
|
|
|
setup:
|
|
|
|
repoDs = SQLiteDatastore.new(Memory).tryGet()
|
|
|
|
metaDs = SQLiteDatastore.new(Memory).tryGet()
|
|
|
|
|
|
|
|
test "Should set started flag once started":
|
2024-06-26 02:38:04 +00:00
|
|
|
let repo = RepoStore.new(repoDs, metaDs, quotaMaxBytes = 200'nb)
|
2023-03-16 15:00:36 +00:00
|
|
|
await repo.start()
|
|
|
|
check repo.started
|
|
|
|
|
|
|
|
test "Should set started flag to false once stopped":
|
2024-06-26 02:38:04 +00:00
|
|
|
let repo = RepoStore.new(repoDs, metaDs, quotaMaxBytes = 200'nb)
|
2023-03-16 15:00:36 +00:00
|
|
|
await repo.start()
|
|
|
|
await repo.stop()
|
|
|
|
check not repo.started
|
|
|
|
|
|
|
|
test "Should allow start to be called multiple times":
|
2024-06-26 02:38:04 +00:00
|
|
|
let repo = RepoStore.new(repoDs, metaDs, quotaMaxBytes = 200'nb)
|
2023-03-16 15:00:36 +00:00
|
|
|
await repo.start()
|
|
|
|
await repo.start()
|
|
|
|
check repo.started
|
|
|
|
|
|
|
|
test "Should allow stop to be called multiple times":
|
2024-06-26 02:38:04 +00:00
|
|
|
let repo = RepoStore.new(repoDs, metaDs, quotaMaxBytes = 200'nb)
|
2023-03-16 15:00:36 +00:00
|
|
|
await repo.stop()
|
|
|
|
await repo.stop()
|
|
|
|
check not repo.started
|
|
|
|
|
2023-06-22 18:01:21 +00:00
|
|
|
asyncchecksuite "RepoStore":
|
2022-12-03 00:00:55 +00:00
|
|
|
var
|
|
|
|
repoDs: Datastore
|
|
|
|
metaDs: Datastore
|
2023-03-08 15:04:54 +00:00
|
|
|
mockClock: MockClock
|
|
|
|
|
|
|
|
repo: RepoStore
|
|
|
|
|
|
|
|
let
|
|
|
|
now: SecondsSince1970 = 123
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
setup:
|
|
|
|
repoDs = SQLiteDatastore.new(Memory).tryGet()
|
|
|
|
metaDs = SQLiteDatastore.new(Memory).tryGet()
|
2023-03-08 15:04:54 +00:00
|
|
|
mockClock = MockClock.new()
|
|
|
|
mockClock.set(now)
|
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
repo = RepoStore.new(repoDs, metaDs, clock = mockClock, quotaMaxBytes = 200'nb)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
teardown:
|
|
|
|
(await repoDs.close()).tryGet
|
|
|
|
(await metaDs.close()).tryGet
|
|
|
|
|
2023-03-08 15:04:54 +00:00
|
|
|
proc createTestBlock(size: int): bt.Block =
|
|
|
|
bt.Block.new('a'.repeat(size).toBytes).tryGet()
|
|
|
|
|
2022-12-03 00:00:55 +00:00
|
|
|
test "Should update current used bytes on block put":
|
2023-03-08 15:04:54 +00:00
|
|
|
let blk = createTestBlock(200)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.quotaUsedBytes == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
(await repo.putBlock(blk)).tryGet
|
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
repo.quotaUsedBytes == 200'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
test "Should update current used bytes on block delete":
|
2023-03-08 15:04:54 +00:00
|
|
|
let blk = createTestBlock(100)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.quotaUsedBytes == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
(await repo.putBlock(blk)).tryGet
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.quotaUsedBytes == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
(await repo.delBlock(blk.cid)).tryGet
|
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
repo.quotaUsedBytes == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2022-12-05 15:00:13 +00:00
|
|
|
test "Should not update current used bytes if block exist":
|
2023-03-08 15:04:54 +00:00
|
|
|
let blk = createTestBlock(100)
|
2022-12-05 15:00:13 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.quotaUsedBytes == 0'nb
|
2022-12-05 15:00:13 +00:00
|
|
|
(await repo.putBlock(blk)).tryGet
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.quotaUsedBytes == 100'nb
|
2022-12-05 15:00:13 +00:00
|
|
|
|
|
|
|
# put again
|
|
|
|
(await repo.putBlock(blk)).tryGet
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.quotaUsedBytes == 100'nb
|
2022-12-05 15:00:13 +00:00
|
|
|
|
2022-12-03 00:00:55 +00:00
|
|
|
test "Should fail storing passed the quota":
|
2023-03-08 15:04:54 +00:00
|
|
|
let blk = createTestBlock(300)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 0'nb
|
|
|
|
expect QuotaNotEnoughError:
|
2022-12-03 00:00:55 +00:00
|
|
|
(await repo.putBlock(blk)).tryGet
|
|
|
|
|
|
|
|
test "Should reserve bytes":
|
2023-03-08 15:04:54 +00:00
|
|
|
let blk = createTestBlock(100)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
(await repo.putBlock(blk)).tryGet
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.reserve(100'nb)).tryGet
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
repo.totalUsed == 200'nb
|
|
|
|
repo.quotaUsedBytes == 100'nb
|
|
|
|
repo.quotaReservedBytes == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
test "Should not reserve bytes over max quota":
|
2023-03-08 15:04:54 +00:00
|
|
|
let blk = createTestBlock(100)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
(await repo.putBlock(blk)).tryGet
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
expect QuotaNotEnoughError:
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.reserve(101'nb)).tryGet
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
repo.totalUsed == 100'nb
|
|
|
|
repo.quotaUsedBytes == 100'nb
|
|
|
|
repo.quotaReservedBytes == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
test "Should release bytes":
|
2023-03-09 11:23:45 +00:00
|
|
|
discard createTestBlock(100)
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 0'nb
|
|
|
|
(await repo.reserve(100'nb)).tryGet
|
|
|
|
check repo.totalUsed == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.release(100'nb)).tryGet
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
repo.totalUsed == 0'nb
|
|
|
|
repo.quotaUsedBytes == 0'nb
|
|
|
|
repo.quotaReservedBytes == 0'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
test "Should not release bytes less than quota":
|
2024-06-26 02:38:04 +00:00
|
|
|
check repo.totalUsed == 0'nb
|
|
|
|
(await repo.reserve(100'nb)).tryGet
|
|
|
|
check repo.totalUsed == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
expect RangeDefect:
|
|
|
|
(await repo.release(101'nb)).tryGet
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
repo.totalUsed == 100'nb
|
|
|
|
repo.quotaUsedBytes == 0'nb
|
|
|
|
repo.quotaReservedBytes == 100'nb
|
2022-12-03 00:00:55 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
proc getExpirations(): Future[seq[BlockExpiration]] {.async.} =
|
|
|
|
let iter = (await repo.getBlockExpirations(100, 0)).tryGet()
|
|
|
|
|
|
|
|
var res = newSeq[BlockExpiration]()
|
|
|
|
for fut in iter:
|
|
|
|
let be = await fut
|
|
|
|
res.add(be)
|
|
|
|
|
|
|
|
res
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
test "Should store block expiration timestamp":
|
|
|
|
let
|
|
|
|
duration = 10.seconds
|
|
|
|
blk = createTestBlock(100)
|
|
|
|
|
|
|
|
let
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + 10)
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
(await repo.putBlock(blk, duration.some)).tryGet
|
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let expirations = await getExpirations()
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration in expirations
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
test "Should store block with default expiration timestamp when not provided":
|
|
|
|
let
|
|
|
|
blk = createTestBlock(100)
|
|
|
|
|
|
|
|
let
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + DefaultBlockTtl.seconds)
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
(await repo.putBlock(blk)).tryGet
|
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let expirations = await getExpirations()
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration in expirations
|
2023-03-08 15:04:54 +00:00
|
|
|
|
2023-11-06 08:10:30 +00:00
|
|
|
test "Should refuse update expiry with negative timestamp":
|
|
|
|
let
|
|
|
|
blk = createTestBlock(100)
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + 10)
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
(await repo.putBlock(blk, some 10.seconds)).tryGet
|
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let expirations = await getExpirations()
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration in expirations
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
expect ValueError:
|
|
|
|
(await repo.ensureExpiry(blk.cid, -1)).tryGet
|
|
|
|
|
|
|
|
expect ValueError:
|
|
|
|
(await repo.ensureExpiry(blk.cid, 0)).tryGet
|
|
|
|
|
|
|
|
test "Should fail when updating expiry of non-existing block":
|
|
|
|
let
|
|
|
|
blk = createTestBlock(100)
|
|
|
|
|
|
|
|
expect BlockNotFoundError:
|
|
|
|
(await repo.ensureExpiry(blk.cid, 10)).tryGet
|
|
|
|
|
|
|
|
test "Should update block expiration timestamp when new expiration is farther":
|
|
|
|
let
|
|
|
|
blk = createTestBlock(100)
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + 10)
|
|
|
|
updatedExpectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + 20)
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.putBlock(blk, some 10.seconds)).tryGet
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let expirations = await getExpirations()
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration in expirations
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.ensureExpiry(blk.cid, now + 20)).tryGet
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let updatedExpirations = await getExpirations()
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration notin updatedExpirations
|
|
|
|
updatedExpectedExpiration in updatedExpirations
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
test "Should not update block expiration timestamp when current expiration is farther then new one":
|
|
|
|
let
|
|
|
|
blk = createTestBlock(100)
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + 10)
|
|
|
|
updatedExpectedExpiration = BlockExpiration(cid: blk.cid, expiry: now + 5)
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.putBlock(blk, some 10.seconds)).tryGet
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let expirations = await getExpirations()
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration in expirations
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
(await repo.ensureExpiry(blk.cid, now + 5)).tryGet
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let updatedExpirations = await getExpirations()
|
2023-11-06 08:10:30 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration in updatedExpirations
|
|
|
|
updatedExpectedExpiration notin updatedExpirations
|
2023-11-06 08:10:30 +00:00
|
|
|
|
2023-03-08 15:04:54 +00:00
|
|
|
test "delBlock should remove expiration metadata":
|
|
|
|
let
|
|
|
|
blk = createTestBlock(100)
|
|
|
|
expectedKey = Key.init("meta/ttl/" & $blk.cid).tryGet
|
|
|
|
|
|
|
|
(await repo.putBlock(blk, 10.seconds.some)).tryGet
|
|
|
|
(await repo.delBlock(blk.cid)).tryGet
|
|
|
|
|
2024-06-26 02:38:04 +00:00
|
|
|
let expirations = await getExpirations()
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
check:
|
2024-06-26 02:38:04 +00:00
|
|
|
expirations.len == 0
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
test "Should retrieve block expiration information":
|
2024-06-26 02:38:04 +00:00
|
|
|
proc unpack(beIter: Future[?!AsyncIter[BlockExpiration]]): Future[seq[BlockExpiration]] {.async.} =
|
2023-03-08 15:04:54 +00:00
|
|
|
var expirations = newSeq[BlockExpiration](0)
|
|
|
|
without iter =? (await beIter), err:
|
|
|
|
return expirations
|
2024-06-26 02:38:04 +00:00
|
|
|
for beFut in toSeq(iter):
|
|
|
|
let value = await beFut
|
|
|
|
expirations.add(value)
|
2023-03-08 15:04:54 +00:00
|
|
|
return expirations
|
|
|
|
|
|
|
|
let
|
|
|
|
duration = 10.seconds
|
|
|
|
blk1 = createTestBlock(10)
|
|
|
|
blk2 = createTestBlock(11)
|
|
|
|
blk3 = createTestBlock(12)
|
|
|
|
|
|
|
|
let
|
2024-06-26 02:38:04 +00:00
|
|
|
expectedExpiration: SecondsSince1970 = now + 10
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
proc assertExpiration(be: BlockExpiration, expectedBlock: bt.Block) =
|
|
|
|
check:
|
|
|
|
be.cid == expectedBlock.cid
|
2024-06-26 02:38:04 +00:00
|
|
|
be.expiry == expectedExpiration
|
2023-03-08 15:04:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
(await repo.putBlock(blk1, duration.some)).tryGet
|
|
|
|
(await repo.putBlock(blk2, duration.some)).tryGet
|
|
|
|
(await repo.putBlock(blk3, duration.some)).tryGet
|
|
|
|
|
|
|
|
let
|
|
|
|
blockExpirations1 = await unpack(repo.getBlockExpirations(maxNumber=2, offset=0))
|
|
|
|
blockExpirations2 = await unpack(repo.getBlockExpirations(maxNumber=2, offset=2))
|
|
|
|
|
|
|
|
check blockExpirations1.len == 2
|
|
|
|
assertExpiration(blockExpirations1[0], blk2)
|
|
|
|
assertExpiration(blockExpirations1[1], blk1)
|
|
|
|
|
|
|
|
check blockExpirations2.len == 1
|
|
|
|
assertExpiration(blockExpirations2[0], blk3)
|
|
|
|
|
2023-08-21 02:51:04 +00:00
|
|
|
test "should put empty blocks":
|
2023-11-14 12:02:17 +00:00
|
|
|
let blk = Cid.example.emptyBlock.tryGet()
|
2023-08-21 02:51:04 +00:00
|
|
|
check (await repo.putBlock(blk)).isOk
|
|
|
|
|
|
|
|
test "should get empty blocks":
|
2023-11-14 12:02:17 +00:00
|
|
|
let blk = Cid.example.emptyBlock.tryGet()
|
2023-08-21 02:51:04 +00:00
|
|
|
|
|
|
|
let got = await repo.getBlock(blk.cid)
|
|
|
|
check got.isOk
|
|
|
|
check got.get.cid == blk.cid
|
|
|
|
|
|
|
|
test "should delete empty blocks":
|
2023-11-14 12:02:17 +00:00
|
|
|
let blk = Cid.example.emptyBlock.tryGet()
|
2023-08-21 02:51:04 +00:00
|
|
|
check (await repo.delBlock(blk.cid)).isOk
|
|
|
|
|
|
|
|
test "should have empty block":
|
2023-11-14 12:02:17 +00:00
|
|
|
let blk = Cid.example.emptyBlock.tryGet()
|
2023-08-21 02:51:04 +00:00
|
|
|
|
|
|
|
let has = await repo.hasBlock(blk.cid)
|
|
|
|
check has.isOk
|
|
|
|
check has.get
|
|
|
|
|
2022-12-03 00:00:55 +00:00
|
|
|
commonBlockStoreTests(
|
|
|
|
"RepoStore Sql backend", proc: BlockStore =
|
|
|
|
BlockStore(
|
|
|
|
RepoStore.new(
|
|
|
|
SQLiteDatastore.new(Memory).tryGet(),
|
2023-03-08 15:04:54 +00:00
|
|
|
SQLiteDatastore.new(Memory).tryGet(),
|
2023-11-14 12:02:17 +00:00
|
|
|
clock = MockClock.new())))
|
2022-12-03 00:00:55 +00:00
|
|
|
|
|
|
|
const
|
|
|
|
path = currentSourcePath().parentDir / "test"
|
|
|
|
|
|
|
|
proc before() {.async.} =
|
|
|
|
createDir(path)
|
|
|
|
|
|
|
|
proc after() {.async.} =
|
|
|
|
removeDir(path)
|
|
|
|
|
|
|
|
let
|
|
|
|
depth = path.split(DirSep).len
|
|
|
|
|
|
|
|
commonBlockStoreTests(
|
|
|
|
"RepoStore FS backend", proc: BlockStore =
|
|
|
|
BlockStore(
|
|
|
|
RepoStore.new(
|
|
|
|
FSDatastore.new(path, depth).tryGet(),
|
2023-03-08 15:04:54 +00:00
|
|
|
SQLiteDatastore.new(Memory).tryGet(),
|
2023-11-14 12:02:17 +00:00
|
|
|
clock = MockClock.new())),
|
2022-12-03 00:00:55 +00:00
|
|
|
before = before,
|
|
|
|
after = after)
|