mirror of https://github.com/status-im/nim-eth.git
Nimble file cleanup and group discv5 tests to compile once (#340)
This commit is contained in:
parent
ae4177851f
commit
207b783253
|
@ -74,7 +74,7 @@ nim-eth dependencies) tests, one can run following command:
|
||||||
# Install required modules
|
# Install required modules
|
||||||
nimble install
|
nimble install
|
||||||
# Run only discovery v5 related test suite
|
# Run only discovery v5 related test suite
|
||||||
nimble tests_discv5
|
nimble tests_discv5_full
|
||||||
```
|
```
|
||||||
|
|
||||||
## dcli
|
## dcli
|
||||||
|
|
67
eth.nimble
67
eth.nimble
|
@ -27,32 +27,17 @@ proc runTest(path: string, release: bool = true, chronosStrict = true) =
|
||||||
" -d:chronicles_log_level=ERROR --verbosity:0 --hints:off " & path
|
" -d:chronicles_log_level=ERROR --verbosity:0 --hints:off " & path
|
||||||
rmFile path
|
rmFile path
|
||||||
|
|
||||||
proc runKeyfileTests() =
|
task test_keyfile, "Run keyfile tests":
|
||||||
runTest("tests/keyfile/all_tests")
|
runTest("tests/keyfile/all_tests")
|
||||||
|
|
||||||
task test_keyfile, "run keyfile tests":
|
task test_keys, "Run keys tests":
|
||||||
runKeyfileTests()
|
|
||||||
|
|
||||||
proc runKeysTests() =
|
|
||||||
runTest("tests/keys/all_tests")
|
runTest("tests/keys/all_tests")
|
||||||
|
|
||||||
task test_keys, "run keys tests":
|
task test_discv5, "Run discovery v5 tests":
|
||||||
runKeysTests()
|
runTest("tests/p2p/all_discv5_tests")
|
||||||
|
|
||||||
proc runDiscv5Tests() =
|
task test_p2p, "Run p2p tests":
|
||||||
for filename in [
|
test_discv5_task()
|
||||||
"test_enr",
|
|
||||||
"test_hkdf",
|
|
||||||
"test_lru",
|
|
||||||
"test_ip_vote",
|
|
||||||
"test_discoveryv5",
|
|
||||||
"test_discoveryv5_encoding",
|
|
||||||
"test_routing_table"
|
|
||||||
]:
|
|
||||||
runTest("tests/p2p/" & filename)
|
|
||||||
|
|
||||||
proc runP2pTests() =
|
|
||||||
runDiscv5Tests()
|
|
||||||
|
|
||||||
for filename in [
|
for filename in [
|
||||||
"les/test_flow_control",
|
"les/test_flow_control",
|
||||||
|
@ -69,10 +54,7 @@ proc runP2pTests() =
|
||||||
]:
|
]:
|
||||||
runTest("tests/p2p/" & filename, chronosStrict = false)
|
runTest("tests/p2p/" & filename, chronosStrict = false)
|
||||||
|
|
||||||
task test_p2p, "run p2p tests":
|
task test_rlp, "Run rlp tests":
|
||||||
runP2pTests()
|
|
||||||
|
|
||||||
proc runRlpTests() =
|
|
||||||
# workaround for github action CI
|
# workaround for github action CI
|
||||||
# mysterious crash on windows-2019 64bit mode
|
# mysterious crash on windows-2019 64bit mode
|
||||||
# cannot reproduce locally on windows-2019
|
# cannot reproduce locally on windows-2019
|
||||||
|
@ -83,35 +65,26 @@ proc runRlpTests() =
|
||||||
|
|
||||||
runTest("tests/rlp/all_tests", releaseMode)
|
runTest("tests/rlp/all_tests", releaseMode)
|
||||||
|
|
||||||
task test_rlp, "run rlp tests":
|
task test_trie, "Run trie tests":
|
||||||
runRlpTests()
|
|
||||||
|
|
||||||
proc runTrieTests() =
|
|
||||||
runTest("tests/trie/all_tests")
|
runTest("tests/trie/all_tests")
|
||||||
|
|
||||||
task test_trie, "run trie tests":
|
task test_db, "Run db tests":
|
||||||
runTrieTests()
|
|
||||||
|
|
||||||
proc runDbTests() =
|
|
||||||
runTest("tests/db/all_tests")
|
runTest("tests/db/all_tests")
|
||||||
|
|
||||||
task test_db, "run db tests":
|
task test, "Run all tests":
|
||||||
runDbTests()
|
|
||||||
|
|
||||||
task test, "run all tests":
|
|
||||||
for filename in [
|
for filename in [
|
||||||
"test_bloom",
|
"test_bloom",
|
||||||
]:
|
]:
|
||||||
runTest("tests/" & filename)
|
runTest("tests/" & filename)
|
||||||
|
|
||||||
runKeyfileTests()
|
test_keyfile_task()
|
||||||
runKeysTests()
|
test_keys_task()
|
||||||
runP2pTests()
|
test_rlp_task()
|
||||||
runRlpTests()
|
test_p2p_task()
|
||||||
runTrieTests()
|
test_trie_task()
|
||||||
runDbTests()
|
test_db_task()
|
||||||
|
|
||||||
task test_discv5, "run tests of discovery v5 and its dependencies":
|
task test_discv5_full, "Run discovery v5 and its dependencies tests":
|
||||||
runKeysTests()
|
test_keys_task()
|
||||||
runRlpTests()
|
test_rlp_task()
|
||||||
runDiscv5Tests()
|
test_discv5_task()
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import
|
||||||
|
test_enr,
|
||||||
|
test_hkdf,
|
||||||
|
test_lru,
|
||||||
|
test_ip_vote,
|
||||||
|
test_routing_table,
|
||||||
|
test_discoveryv5_encoding,
|
||||||
|
test_discoveryv5
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/tables,
|
std/tables,
|
||||||
chronos, chronicles, stint, testutils/unittests,
|
chronos, chronicles, stint, testutils/unittests,
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[unittest, options, sequtils, tables],
|
std/[unittest, options, sequtils, tables],
|
||||||
stint, stew/byteutils, stew/shims/net,
|
stint, stew/byteutils, stew/shims/net,
|
||||||
eth/[rlp, keys],
|
eth/keys,
|
||||||
eth/p2p/discoveryv5/[messages, encoding, enr, node, sessions]
|
eth/p2p/discoveryv5/[messages, encoding, enr, node, sessions]
|
||||||
|
|
||||||
let rng = newRng()
|
let rng = newRng()
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[unittest, options, sequtils],
|
std/[unittest, options, sequtils],
|
||||||
nimcrypto/utils, stew/shims/net,
|
nimcrypto/utils, stew/shims/net,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/unittest,
|
std/unittest,
|
||||||
nimcrypto, stew/byteutils,
|
nimcrypto, stew/byteutils,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/unittest,
|
std/unittest,
|
||||||
eth/keys, stew/shims/net,
|
eth/keys, stew/shims/net,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[unittest, options],
|
std/[unittest, options],
|
||||||
eth/p2p/discoveryv5/lru
|
eth/p2p/discoveryv5/lru
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
{.used.}
|
||||||
|
|
||||||
import
|
import
|
||||||
std/unittest,
|
std/unittest,
|
||||||
bearssl, eth/keys, eth/p2p/discoveryv5/[routing_table, node, enr],
|
bearssl, eth/keys, eth/p2p/discoveryv5/[routing_table, node, enr],
|
||||||
|
|
Loading…
Reference in New Issue