update asynctest to 0.5.1 (#671)

* update asynctest to 0.5.0

Co-Authored-By: gmega <giuliano.mega@gmail.com>

* update remaining package imports

* add asynctest package wrapper

---------

Co-authored-by: gmega <giuliano.mega@gmail.com>
This commit is contained in:
markspanbroek 2024-01-29 21:03:51 +01:00 committed by GitHub
parent 95a4484de0
commit fd3c566b25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 94 additions and 74 deletions

View File

@ -5,7 +5,7 @@
"hostOS": "macosx",
"items": {
"asynctest": {
"commit": "fe1a34caf572b05f8bdba3b650f1871af9fce31e",
"commit": "8e2f4e73b97123be0f0041c129942b32df23ecb1",
"dir": "vendor/asynctest",
"url": "https://github.com/codex-storage/asynctest"
},

View File

@ -7,7 +7,7 @@ srcDir = "."
installFiles = @["build.nims"]
requires "nim >= 1.2.0"
requires "asynctest >= 0.3.2 & < 0.4.0"
requires "asynctest >= 0.5.1 & < 0.6.0"
requires "bearssl >= 0.1.4"
requires "chronicles >= 0.7.2"
requires "chronos >= 2.5.2"

3
tests/asynctest.nim Normal file
View File

@ -0,0 +1,3 @@
import pkg/asynctest/chronos/unittest
export unittest

View File

@ -3,25 +3,26 @@ import ./helpers
## Unit testing suite that calls checkTrackers in teardown to check for memory leaks using chronos trackers.
template checksuite*(name, body) =
suite name:
multisetup()
proc suiteProc =
multisetup()
teardown:
checkTrackers()
teardown:
checkTrackers()
# Avoids GcUnsafe2 warnings with chronos
# Copied from asynctest/templates.nim
let suiteproc = proc =
body
suiteproc()
suiteProc()
template asyncchecksuite*(name, body) =
suite name:
asyncmultisetup()
proc suiteProc =
asyncmultisetup()
teardown:
checkTrackers()
teardown:
checkTrackers()
body
body
suiteProc()
export helpers

View File

@ -2,7 +2,6 @@ import std/sequtils
import std/sugar
import std/tables
import pkg/asynctest
import pkg/chronos
import pkg/libp2p/errors
@ -15,11 +14,12 @@ import pkg/codex/manifest
import pkg/codex/merkletree
import pkg/codex/blocktype as bt
import ../../helpers/mockdiscovery
import ../../../asynctest
import ../../helpers
import ../../helpers/mockdiscovery
import ../../examples
asyncchecksuite "Block Advertising and Discovery":
let chunker = RandomChunker.new(Rng.instance(), size = 4096, chunkSize = 256)

View File

@ -2,8 +2,6 @@ import std/sequtils
import std/sugar
import std/tables
import pkg/asynctest
import pkg/chronos
import pkg/codex/rng
@ -13,9 +11,9 @@ import pkg/codex/chunker
import pkg/codex/blocktype as bt
import pkg/codex/blockexchange/engine
import ../../helpers/mockdiscovery
import ../../../asynctest
import ../../helpers
import ../../helpers/mockdiscovery
import ../../examples
asyncchecksuite "Test Discovery Engine":

View File

@ -1,7 +1,6 @@
import std/sequtils
import std/algorithm
import pkg/asynctest
import pkg/chronos
import pkg/stew/byteutils
@ -12,6 +11,7 @@ import pkg/codex/chunker
import pkg/codex/discovery
import pkg/codex/blocktype as bt
import ../../../asynctest
import ../../examples
import ../../helpers

View File

@ -3,7 +3,6 @@ import std/random
import std/algorithm
import pkg/stew/byteutils
import pkg/asynctest
import pkg/chronos
import pkg/libp2p/errors
import pkg/libp2p/routing_record
@ -17,6 +16,7 @@ import pkg/codex/discovery
import pkg/codex/blocktype
import pkg/codex/utils/asyncheapqueue
import ../../../asynctest
import ../../helpers
import ../../examples

View File

@ -1,9 +1,11 @@
import pkg/asynctest
import pkg/chronos
import pkg/stew/byteutils
import pkg/codex/stores
import ../../../asynctest
import ../../examples
import ../../helpers
import pkg/codex/stores
checksuite "account protobuf messages":

View File

@ -1,13 +1,14 @@
import pkg/asynctest
import pkg/chronos
import pkg/codex/blockexchange/protobuf/presence
import ../../../asynctest
import ../../examples
import ../../helpers
checksuite "block presence protobuf messages":
let
let
cid = Cid.example
address = BlockAddress(leaf: false, cid: cid)
price = UInt256.example

View File

@ -1,7 +1,6 @@
import std/sequtils
import std/tables
import pkg/asynctest
import pkg/chronos
import pkg/codex/rng
@ -9,8 +8,9 @@ import pkg/codex/chunker
import pkg/codex/blocktype as bt
import pkg/codex/blockexchange
import ../helpers
import ../../asynctest
import ../examples
import ../helpers
asyncchecksuite "Network - Handlers":
let

View File

@ -1,7 +1,7 @@
import std/sugar
import std/sequtils
import std/unittest
import pkg/unittest2
import pkg/libp2p
import pkg/codex/blockexchange/peers

View File

@ -2,13 +2,13 @@ import std/sequtils
import std/algorithm
import pkg/chronos
import pkg/asynctest
import pkg/stew/byteutils
import pkg/codex/blocktype as bt
import pkg/codex/blockexchange
import ../helpers
import ../../asynctest
checksuite "Pending Blocks":
test "Should add want handle":

View File

@ -3,11 +3,12 @@ import std/times
import pkg/libp2p
import pkg/chronos
import pkg/asynctest
import pkg/codex/codextypes
import pkg/codex/chunker
import ../../asynctest
proc toTimesDuration*(d: chronos.Duration): times.Duration =
initDuration(seconds = d.seconds)

View File

@ -5,7 +5,6 @@ import std/times
import std/sequtils
import std/importutils
import pkg/asynctest
import pkg/chronos
import pkg/stew/byteutils
import pkg/datastore
@ -35,6 +34,7 @@ import pkg/codex/utils/asynciter
import pkg/codex/node {.all.}
import ../../asynctest
import ../../examples
import ../helpers
import ../helpers/mockmarket

View File

@ -5,7 +5,6 @@ import std/times
import std/sequtils
import std/importutils
import pkg/asynctest
import pkg/chronos
import pkg/stew/byteutils
import pkg/datastore
@ -34,6 +33,7 @@ import pkg/codex/blocktype as bt
import pkg/codex/node {.all.}
import ../../asynctest
import ../examples
import ../helpers
import ../helpers/mockmarket

View File

@ -1,4 +1,3 @@
import pkg/asynctest
import pkg/questionable/results
import pkg/codex/clock
@ -11,6 +10,7 @@ import pkg/codex/sales/states/errored
import pkg/codex/sales/states/proving
import pkg/codex/sales/states/finished
import ../../../asynctest
import ../../helpers/mockmarket
import ../../examples
import ../../helpers

View File

@ -1,4 +1,3 @@
import pkg/asynctest
import pkg/questionable
import pkg/chronos
import pkg/codex/contracts/requests
@ -10,6 +9,8 @@ import pkg/codex/sales/states/errored
import pkg/codex/sales/salesagent
import pkg/codex/sales/salescontext
import pkg/codex/market
import ../../../asynctest
import ../../examples
import ../../helpers
import ../../helpers/mockmarket

View File

@ -1,4 +1,3 @@
import pkg/asynctest
import pkg/chronos
import pkg/questionable
import pkg/codex/contracts/requests
@ -8,6 +7,8 @@ import pkg/codex/sales/states/failed
import pkg/codex/sales/states/payout
import pkg/codex/sales/salesagent
import pkg/codex/sales/salescontext
import ../../../asynctest
import ../../examples
import ../../helpers
import ../../helpers/mockmarket

View File

@ -1,4 +1,3 @@
import pkg/asynctest
import pkg/chronos
import pkg/questionable
import pkg/codex/contracts/requests
@ -9,6 +8,8 @@ import pkg/codex/sales/states/failed
import pkg/codex/sales/states/payout
import pkg/codex/sales/salesagent
import pkg/codex/sales/salescontext
import ../../../asynctest
import ../../examples
import ../../helpers
import ../../helpers/mockmarket

View File

@ -1,4 +1,3 @@
import pkg/asynctest
import pkg/codex/contracts/requests
import pkg/codex/sales
import pkg/codex/sales/salesagent
@ -9,6 +8,8 @@ import pkg/codex/sales/states/filled
import pkg/codex/sales/states/finished
import pkg/codex/sales/states/failed
import pkg/codex/sales/states/payout
import ../../../asynctest
import ../../helpers/mockmarket
import ../../examples
import ../../helpers

View File

@ -3,13 +3,13 @@ import std/random
import pkg/questionable
import pkg/questionable/results
import pkg/chronos
import pkg/asynctest
import pkg/datastore
import pkg/codex/stores
import pkg/codex/sales
import pkg/codex/utils/json
import ../../asynctest
import ../examples
import ../helpers

View File

@ -1,7 +1,6 @@
import std/sequtils
import std/sugar
import std/times
import pkg/asynctest
import pkg/chronos
import pkg/datastore
import pkg/questionable
@ -14,6 +13,7 @@ import pkg/codex/sales/slotqueue
import pkg/codex/stores/repostore
import pkg/codex/blocktype as bt
import pkg/codex/node
import ../../asynctest
import ../helpers
import ../helpers/mockmarket
import ../helpers/mockclock

View File

@ -1,5 +1,4 @@
import std/times
import pkg/asynctest
import pkg/chronos
import pkg/codex/sales
import pkg/codex/sales/salesagent
@ -7,6 +6,8 @@ import pkg/codex/sales/salescontext
import pkg/codex/sales/statemachine
import pkg/codex/sales/states/errorhandling
import pkg/codex/proving
import ../../asynctest
import ../helpers/mockmarket
import ../helpers/mockclock
import ../helpers

View File

@ -1,5 +1,5 @@
import std/sequtils
import pkg/asynctest
import pkg/chronicles
import pkg/chronos
import pkg/datastore
import pkg/questionable
@ -8,6 +8,7 @@ import pkg/questionable/results
import pkg/codex/logutils
import pkg/codex/sales/slotqueue
import ../../asynctest
import ../helpers
import ../helpers/mockmarket
import ../examples

View File

@ -1,12 +1,12 @@
import pkg/chronos
import pkg/asynctest
import pkg/poseidon2
import pkg/poseidon2/io
import pkg/constantine/math/io/io_fields
import pkg/questionable/results
import pkg/codex/merkletree
import pkg/codex/slots/converters
import ../../asynctest
import ../examples
import ../merkletree/helpers

View File

@ -9,7 +9,6 @@ import pkg/constantine/math/io/io_fields
import pkg/poseidon2/io
import pkg/poseidon2
import pkg/chronos
import pkg/asynctest
import pkg/nimcrypto
import pkg/codex/stores/cachestore
import pkg/codex/chunker
@ -26,7 +25,8 @@ import pkg/codex/slots/builder/builder
import ../helpers
import ../examples
import ../merkletree/helpers
import testsampler_expected
import ../../asynctest
import ./testsampler_expected
import ./provingtestenv
asyncchecksuite "Test DataSampler":

View File

@ -4,7 +4,6 @@ import std/importutils
import std/sugar
import pkg/chronos
import pkg/asynctest
import pkg/questionable/results
import pkg/codex/blocktype as bt
import pkg/codex/rng
@ -19,6 +18,7 @@ import pkg/poseidon2
import pkg/poseidon2/io
import constantine/math/io/io_fields
import ../../asynctest
import ../helpers
import ../examples
import ../merkletree/helpers

View File

@ -10,7 +10,6 @@ import pkg/constantine/math/io/io_fields
import pkg/poseidon2/io
import pkg/poseidon2
import pkg/chronos
import pkg/asynctest
import pkg/codex/stores/cachestore
import pkg/codex/chunker
import pkg/codex/stores
@ -22,6 +21,7 @@ import pkg/codex/stores/cachestore
import pkg/codex/slots/sampler/utils
import ../../asynctest
import ../helpers
import ../examples
import ../merkletree/helpers

View File

@ -3,7 +3,6 @@ import std/strutils
import std/options
import pkg/chronos
import pkg/asynctest
import pkg/libp2p/multicodec
import pkg/stew/byteutils
import pkg/questionable
@ -14,6 +13,7 @@ import pkg/codex/manifest
import pkg/codex/merkletree
import pkg/codex/utils
import ../../asynctest
import ../helpers
type

View File

@ -1,7 +1,6 @@
import std/strutils
import pkg/chronos
import pkg/asynctest
import pkg/stew/byteutils
import pkg/questionable/results
import pkg/codex/stores/cachestore
@ -9,6 +8,7 @@ import pkg/codex/chunker
import ./commonstoretests
import ../../asynctest
import ../helpers
checksuite "Cache Store":

View File

@ -10,13 +10,13 @@
import std/random
import std/sequtils
import pkg/chronos
import pkg/asynctest
import pkg/questionable
import pkg/questionable/results
import pkg/codex/blocktype as bt
import pkg/codex/stores/repostore
import pkg/codex/clock
import ../../asynctest
import ../helpers/mocktimer
import ../helpers/mockrepostore
import ../helpers/mockclock

View File

@ -8,12 +8,12 @@
## those terms.
import pkg/chronos
import pkg/asynctest
import pkg/questionable/results
import pkg/codex/blocktype as bt
import pkg/codex/stores/repostore
import pkg/codex/clock
import ../../asynctest
import ../helpers
import ../helpers/mocktimer
import ../helpers/mockrepostore

View File

@ -6,7 +6,6 @@ import pkg/questionable
import pkg/questionable/results
import pkg/chronos
import pkg/asynctest
import pkg/stew/byteutils
import pkg/stew/endians2
import pkg/datastore
@ -18,6 +17,7 @@ import pkg/codex/blocktype as bt
import pkg/codex/clock
import pkg/codex/utils/asynciter
import ../../asynctest
import ../helpers
import ../helpers/mockclock
import ../examples

View File

@ -1,10 +1,10 @@
import pkg/chronos
import pkg/asynctest
import pkg/stew/results
import pkg/codex/utils/asyncheapqueue
import pkg/codex/rng
import ../asynctest
import ./helpers
type

View File

@ -1,4 +1,3 @@
import pkg/asynctest
import pkg/chronos
import pkg/chronos/transports/stream
import pkg/chronos/transports/common
@ -6,6 +5,7 @@ import pkg/chronos/streams/asyncstream
import pkg/codex/streams
import pkg/stew/byteutils
import ../asynctest
import ./helpers
asyncchecksuite "AsyncStreamWrapper":

View File

@ -1,10 +1,10 @@
import pkg/asynctest
import pkg/stew/byteutils
import pkg/codex/chunker
import pkg/codex/logutils
import pkg/chronos
import ../asynctest
import ./helpers
asyncchecksuite "Chunking":

View File

@ -1,7 +1,6 @@
import std/sequtils
import std/sugar
import pkg/asynctest
import pkg/chronos
import pkg/datastore
import pkg/questionable/results
@ -13,6 +12,7 @@ import pkg/codex/blocktype as bt
import pkg/codex/rng
import pkg/codex/utils
import ../asynctest
import ./helpers
suite "Erasure encode/decode":

View File

@ -1,9 +1,9 @@
import std/sequtils
import pkg/chronos
import pkg/asynctest
import pkg/codex/utils/asynciter
import ../asynctest
import ./helpers
import pkg/codex/indexingstrategy

View File

@ -2,7 +2,6 @@ import std/sequtils
import pkg/chronos
import pkg/questionable/results
import pkg/asynctest
import pkg/codex/chunker
import pkg/codex/blocktype as bt
import pkg/codex/manifest
@ -11,6 +10,7 @@ import pkg/poseidon2
import pkg/codex/slots
import pkg/codex/merkletree
import ../asynctest
import ./helpers
import ./examples

View File

@ -1,5 +1,4 @@
import std/times
import pkg/asynctest
import pkg/chronos
import pkg/stint
import pkg/codex/purchasing
@ -9,6 +8,8 @@ import pkg/codex/purchasing/states/submitted
import pkg/codex/purchasing/states/unknown
import pkg/codex/purchasing/states/cancelled
import pkg/codex/purchasing/states/failed
import ../asynctest
import ./helpers/mockmarket
import ./helpers/mockclock
import ./examples

View File

@ -1,14 +1,14 @@
import pkg/chronos
import pkg/asynctest
import pkg/questionable/results
import ./helpers
import pkg/codex/streams
import pkg/codex/stores
import pkg/codex/manifest
import pkg/codex/blocktype as bt
import ../asynctest
import ./helpers
asyncchecksuite "StoreStream":
var
manifest: Manifest

View File

@ -1,8 +1,9 @@
import pkg/asynctest
import pkg/chronos
import codex/validation
import codex/periods
import ../asynctest
import ./helpers/mockmarket
import ./helpers/mockclock
import ./examples

View File

@ -1,8 +1,9 @@
import pkg/asynctest
import pkg/questionable
import pkg/chronos
import pkg/upraises
import codex/utils/asyncstatemachine
import ../../asynctest
import ../helpers
type

View File

@ -1,8 +1,9 @@
import pkg/asynctest
import pkg/chronos
import pkg/questionable
import pkg/questionable/results
import codex/utils/then
import ../../asynctest
import ../helpers
proc newError(): ref CatchableError =

View File

@ -8,9 +8,10 @@
## those terms.
import pkg/chronos
import pkg/asynctest
import codex/utils/timer
import ../../asynctest
import ../helpers
asyncchecksuite "Timer":

View File

@ -1,6 +1,7 @@
import pkg/asynctest
import pkg/chronos
import codex/utils/trackedfutures
import ../../asynctest
import ../helpers
type Module = object

View File

@ -1,9 +1,9 @@
import pkg/asynctest
import pkg/ethers
import codex/contracts/deployment
import codex/conf
import codex/contracts
import ../asynctest
import ../checktest
type MockProvider = ref object of Provider

View File

@ -1,7 +1,7 @@
import pkg/asynctest
import std/json
import pkg/ethers
import ./asynctest
import ./checktest
## Unit testing suite that sets up an Ethereum testing environment.
@ -25,5 +25,5 @@ template ethersuite*(name, body) =
body
export asynctest
export unittest
export ethers except `%`

View File

@ -2,13 +2,15 @@ import std/times
import std/os
import std/json
import std/tempfiles
import pkg/asynctest
import pkg/chronos
import pkg/stint
import pkg/questionable
import pkg/questionable/results
import ./asynctest
import ./integration/nodes
suite "Taiko L2 Integration Tests":
var node1, node2: NodeProcess

2
vendor/asynctest vendored

@ -1 +1 @@
Subproject commit fe1a34caf572b05f8bdba3b650f1871af9fce31e
Subproject commit 8e2f4e73b97123be0f0041c129942b32df23ecb1