Skip to content

Commit

Permalink
Remove obsolete tests (#2307)
Browse files Browse the repository at this point in the history
* Remove `test_sync_snap`

why:
  Snap sync needs to be re-factored. All the interesting database parts
  from this test suite has been recycled into `Aristo`

* Remove `test_rocksdb_timing`

* Update `all_tests`
  • Loading branch information
mjfh authored Jun 6, 2024
1 parent 0268093 commit 1e65093
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 3,319 deletions.
2 changes: 0 additions & 2 deletions tests/all_tests.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import ./all_tests_macro
cliBuilder:
import ./test_code_stream,
#./test_accounts_cache, -- does not compile
#./test_sync_snap, -- temporarily suspended
#./test_rocksdb_timing, -- probably redundant
#./test_jwt_auth, -- rpc is Aristo incompatible
./test_gas_meter,
./test_memory,
Expand Down
5 changes: 2 additions & 3 deletions tests/test_aristo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ import
unittest2,
../nimbus/db/aristo/[aristo_desc, aristo_merge],
./replay/[pp, undump_accounts, undump_storages],
./test_sync_snap/[snap_test_xx, test_types],
./test_aristo/[test_filter, test_helpers, test_misc, test_tx]
./test_aristo/[test_samples_xx, test_filter, test_helpers, test_misc, test_tx]

const
baseDir = [".", "..", ".."/"..", $DirSep]
repoDir = [".", "tests", "nimbus-eth1-blobs"]
subDir = ["replay", "test_sync_snap", "replay"/"snap"]
subDir = ["replay", "test_aristo", "replay"/"snap"]

# Reference file for finding the database directory
sampleDirRefFile = "sample0.txt.gz"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_aristo/test_helpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import
aristo_hashify, aristo_hike, aristo_merge],
../../nimbus/db/kvstore_rocksdb,
../../nimbus/sync/protocol/snap/snap_types,
../test_sync_snap/test_types,
../replay/[pp, undump_accounts, undump_storages]
../replay/[pp, undump_accounts, undump_storages],
./test_samples_xx

from ../../nimbus/sync/snap/range_desc
import NodeKey, ByteArray32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,65 @@

import
std/os,
./test_types
eth/common

type
AccountsSample* = object
name*: string ## sample name, also used as sub-directory for db separation
file*: string
firstItem*: int
lastItem*: int

CaptureSpecs* = object
name*: string ## sample name, also used as sub-directory for db separation
network*: NetworkId
file*: string ## name of capture file
numBlocks*: int ## Number of blocks to load

SnapSyncSpecs* = object
name*: string
network*: NetworkId
snapDump*: string
tailBlocks*: string
pivotBlock*: uint64
nItems*: int

const
snapTest0* = AccountsSample(
name: "sample0",
file: "sample0.txt.gz",
firstItem: 0,
lastItem: high(int))

snapTest1* = AccountsSample(
name: "test1",
file: snapTest0.file,
lastItem: 0) # Only the first `snap/1` reply from the sample

snapTest2* = AccountsSample(
name: "sample1",
file: "sample1.txt.gz",
lastItem: high(int))

snapTest3* = AccountsSample(
name: "test3",
file: snapTest2.file,
lastItem: 0) # Only the first `snap/1` reply from the sample

# Also for storage tests
snapTest4* = AccountsSample(
name: "sample2",
file: "sample2.txt.gz",
lastItem: high(int))

# Also for storage tests
snapTest5* = AccountsSample(
name: "sample3",
file: "sample3.txt.gz",
lastItem: high(int))

# ----------------------

snapOther0a* = AccountsSample(
name: "Other0a",
file: "account" / "account0_00_06_dump.txt.gz",
Expand Down Expand Up @@ -125,6 +181,12 @@ const

# ------------------------

snapTestList* = [
snapTest0, snapTest1, snapTest2, snapTest3]

snapTestStorageList* = [
snapTest4, snapTest5]

snapOtherHealingList* = [
@[snapOther0b, snapOther2, snapOther4],
@[snapOther0a, snapOther1a, snapOther5]]
Expand Down
Loading

0 comments on commit 1e65093

Please sign in to comment.