From fd3c566b255bc772b847ba17ed0ce8e63ddaf063 Mon Sep 17 00:00:00 2001 From: markspanbroek Date: Mon, 29 Jan 2024 21:03:51 +0100 Subject: [PATCH] update asynctest to 0.5.1 (#671) * update asynctest to 0.5.0 Co-Authored-By: gmega * update remaining package imports * add asynctest package wrapper --------- Co-authored-by: gmega --- atlas.lock | 2 +- codex.nimble | 2 +- tests/asynctest.nim | 3 +++ tests/checktest.nim | 23 ++++++++++--------- .../blockexchange/discovery/testdiscovery.nim | 6 ++--- .../discovery/testdiscoveryengine.nim | 6 ++--- .../blockexchange/engine/testblockexc.nim | 2 +- .../codex/blockexchange/engine/testengine.nim | 2 +- .../blockexchange/protobuf/testpayments.nim | 6 +++-- .../blockexchange/protobuf/testpresence.nim | 5 ++-- tests/codex/blockexchange/testnetwork.nim | 4 ++-- .../codex/blockexchange/testpeerctxstore.nim | 2 +- .../codex/blockexchange/testpendingblocks.nim | 2 +- tests/codex/node/helpers.nim | 3 ++- tests/codex/node/testcontracts.nim | 2 +- tests/codex/node/testnode.nim | 2 +- tests/codex/sales/states/testfilled.nim | 2 +- .../codex/sales/states/testinitialproving.nim | 3 ++- tests/codex/sales/states/testproving.nim | 3 ++- .../sales/states/testsimulatedproving.nim | 3 ++- tests/codex/sales/states/testunknown.nim | 3 ++- tests/codex/sales/testreservations.nim | 2 +- tests/codex/sales/testsales.nim | 2 +- tests/codex/sales/testsalesagent.nim | 3 ++- tests/codex/sales/testslotqueue.nim | 3 ++- tests/codex/slots/testconverters.nim | 4 ++-- tests/codex/slots/testsampler.nim | 4 ++-- tests/codex/slots/testslotbuilder.nim | 2 +- tests/codex/slots/testutils.nim | 2 +- tests/codex/stores/commonstoretests.nim | 2 +- tests/codex/stores/testcachestore.nim | 2 +- tests/codex/stores/testkeyutils.nim | 2 +- tests/codex/stores/testmaintenance.nim | 2 +- tests/codex/stores/testrepostore.nim | 2 +- tests/codex/testasyncheapqueue.nim | 2 +- tests/codex/testasyncstreamwrapper.nim | 2 +- tests/codex/testchunking.nim | 2 +- tests/codex/testerasure.nim | 2 +- tests/codex/testindexingstrategy.nim | 2 +- tests/codex/testmanifest.nim | 2 +- tests/codex/testpurchasing.nim | 3 ++- tests/codex/teststorestream.nim | 6 ++--- tests/codex/testvalidation.nim | 3 ++- tests/codex/utils/testasyncstatemachine.nim | 3 ++- tests/codex/utils/testthen.nim | 3 ++- tests/codex/utils/testtimer.nim | 3 ++- tests/codex/utils/testtrackedfutures.nim | 3 ++- tests/contracts/testDeployment.nim | 2 +- tests/ethertest.nim | 6 ++--- tests/testTaiko.nim | 4 +++- vendor/asynctest | 2 +- 51 files changed, 94 insertions(+), 74 deletions(-) create mode 100644 tests/asynctest.nim diff --git a/atlas.lock b/atlas.lock index c45cfae1..497023cf 100644 --- a/atlas.lock +++ b/atlas.lock @@ -5,7 +5,7 @@ "hostOS": "macosx", "items": { "asynctest": { - "commit": "fe1a34caf572b05f8bdba3b650f1871af9fce31e", + "commit": "8e2f4e73b97123be0f0041c129942b32df23ecb1", "dir": "vendor/asynctest", "url": "https://github.com/codex-storage/asynctest" }, diff --git a/codex.nimble b/codex.nimble index 2156919f..41da92b7 100644 --- a/codex.nimble +++ b/codex.nimble @@ -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" diff --git a/tests/asynctest.nim b/tests/asynctest.nim new file mode 100644 index 00000000..7c6a4afd --- /dev/null +++ b/tests/asynctest.nim @@ -0,0 +1,3 @@ +import pkg/asynctest/chronos/unittest + +export unittest diff --git a/tests/checktest.nim b/tests/checktest.nim index 33848a78..8ca5c53e 100644 --- a/tests/checktest.nim +++ b/tests/checktest.nim @@ -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 diff --git a/tests/codex/blockexchange/discovery/testdiscovery.nim b/tests/codex/blockexchange/discovery/testdiscovery.nim index ad02d6cb..28d315f4 100644 --- a/tests/codex/blockexchange/discovery/testdiscovery.nim +++ b/tests/codex/blockexchange/discovery/testdiscovery.nim @@ -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) diff --git a/tests/codex/blockexchange/discovery/testdiscoveryengine.nim b/tests/codex/blockexchange/discovery/testdiscoveryengine.nim index 7b599573..3984fe6a 100644 --- a/tests/codex/blockexchange/discovery/testdiscoveryengine.nim +++ b/tests/codex/blockexchange/discovery/testdiscoveryengine.nim @@ -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": diff --git a/tests/codex/blockexchange/engine/testblockexc.nim b/tests/codex/blockexchange/engine/testblockexc.nim index e1a8fef3..33ec374e 100644 --- a/tests/codex/blockexchange/engine/testblockexc.nim +++ b/tests/codex/blockexchange/engine/testblockexc.nim @@ -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 diff --git a/tests/codex/blockexchange/engine/testengine.nim b/tests/codex/blockexchange/engine/testengine.nim index 5c960bb0..d1a5f242 100644 --- a/tests/codex/blockexchange/engine/testengine.nim +++ b/tests/codex/blockexchange/engine/testengine.nim @@ -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 diff --git a/tests/codex/blockexchange/protobuf/testpayments.nim b/tests/codex/blockexchange/protobuf/testpayments.nim index 9760d6c8..81bc5dfc 100644 --- a/tests/codex/blockexchange/protobuf/testpayments.nim +++ b/tests/codex/blockexchange/protobuf/testpayments.nim @@ -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": diff --git a/tests/codex/blockexchange/protobuf/testpresence.nim b/tests/codex/blockexchange/protobuf/testpresence.nim index 6011aeff..963dd0ec 100644 --- a/tests/codex/blockexchange/protobuf/testpresence.nim +++ b/tests/codex/blockexchange/protobuf/testpresence.nim @@ -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 diff --git a/tests/codex/blockexchange/testnetwork.nim b/tests/codex/blockexchange/testnetwork.nim index eecf231a..756d86a1 100644 --- a/tests/codex/blockexchange/testnetwork.nim +++ b/tests/codex/blockexchange/testnetwork.nim @@ -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 diff --git a/tests/codex/blockexchange/testpeerctxstore.nim b/tests/codex/blockexchange/testpeerctxstore.nim index 868e0819..6d7a1af3 100644 --- a/tests/codex/blockexchange/testpeerctxstore.nim +++ b/tests/codex/blockexchange/testpeerctxstore.nim @@ -1,7 +1,7 @@ import std/sugar import std/sequtils +import std/unittest -import pkg/unittest2 import pkg/libp2p import pkg/codex/blockexchange/peers diff --git a/tests/codex/blockexchange/testpendingblocks.nim b/tests/codex/blockexchange/testpendingblocks.nim index 21637515..dd94c4da 100644 --- a/tests/codex/blockexchange/testpendingblocks.nim +++ b/tests/codex/blockexchange/testpendingblocks.nim @@ -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": diff --git a/tests/codex/node/helpers.nim b/tests/codex/node/helpers.nim index 0501de18..a9a3ea76 100644 --- a/tests/codex/node/helpers.nim +++ b/tests/codex/node/helpers.nim @@ -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) diff --git a/tests/codex/node/testcontracts.nim b/tests/codex/node/testcontracts.nim index 601912f1..eea35e28 100644 --- a/tests/codex/node/testcontracts.nim +++ b/tests/codex/node/testcontracts.nim @@ -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 diff --git a/tests/codex/node/testnode.nim b/tests/codex/node/testnode.nim index 51dd7e0d..246b94f4 100644 --- a/tests/codex/node/testnode.nim +++ b/tests/codex/node/testnode.nim @@ -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 diff --git a/tests/codex/sales/states/testfilled.nim b/tests/codex/sales/states/testfilled.nim index 92a004a3..1e5e292f 100644 --- a/tests/codex/sales/states/testfilled.nim +++ b/tests/codex/sales/states/testfilled.nim @@ -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 diff --git a/tests/codex/sales/states/testinitialproving.nim b/tests/codex/sales/states/testinitialproving.nim index e083b68b..a47406a2 100644 --- a/tests/codex/sales/states/testinitialproving.nim +++ b/tests/codex/sales/states/testinitialproving.nim @@ -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 diff --git a/tests/codex/sales/states/testproving.nim b/tests/codex/sales/states/testproving.nim index 3658b06f..a14d3975 100644 --- a/tests/codex/sales/states/testproving.nim +++ b/tests/codex/sales/states/testproving.nim @@ -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 diff --git a/tests/codex/sales/states/testsimulatedproving.nim b/tests/codex/sales/states/testsimulatedproving.nim index 164d4fdc..e9efa617 100644 --- a/tests/codex/sales/states/testsimulatedproving.nim +++ b/tests/codex/sales/states/testsimulatedproving.nim @@ -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 diff --git a/tests/codex/sales/states/testunknown.nim b/tests/codex/sales/states/testunknown.nim index 7c8e275a..e02b3c90 100644 --- a/tests/codex/sales/states/testunknown.nim +++ b/tests/codex/sales/states/testunknown.nim @@ -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 diff --git a/tests/codex/sales/testreservations.nim b/tests/codex/sales/testreservations.nim index a6ab1b26..08c0bf95 100644 --- a/tests/codex/sales/testreservations.nim +++ b/tests/codex/sales/testreservations.nim @@ -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 diff --git a/tests/codex/sales/testsales.nim b/tests/codex/sales/testsales.nim index baa3fbc9..6241073b 100644 --- a/tests/codex/sales/testsales.nim +++ b/tests/codex/sales/testsales.nim @@ -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 diff --git a/tests/codex/sales/testsalesagent.nim b/tests/codex/sales/testsalesagent.nim index 48a4f9d9..329e7b68 100644 --- a/tests/codex/sales/testsalesagent.nim +++ b/tests/codex/sales/testsalesagent.nim @@ -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 diff --git a/tests/codex/sales/testslotqueue.nim b/tests/codex/sales/testslotqueue.nim index 18d1e429..2e30fb3a 100644 --- a/tests/codex/sales/testslotqueue.nim +++ b/tests/codex/sales/testslotqueue.nim @@ -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 diff --git a/tests/codex/slots/testconverters.nim b/tests/codex/slots/testconverters.nim index d76302bb..cf18d6b2 100644 --- a/tests/codex/slots/testconverters.nim +++ b/tests/codex/slots/testconverters.nim @@ -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 diff --git a/tests/codex/slots/testsampler.nim b/tests/codex/slots/testsampler.nim index a2898b67..3c3eb5f8 100644 --- a/tests/codex/slots/testsampler.nim +++ b/tests/codex/slots/testsampler.nim @@ -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": diff --git a/tests/codex/slots/testslotbuilder.nim b/tests/codex/slots/testslotbuilder.nim index bf710f76..3d72351e 100644 --- a/tests/codex/slots/testslotbuilder.nim +++ b/tests/codex/slots/testslotbuilder.nim @@ -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 diff --git a/tests/codex/slots/testutils.nim b/tests/codex/slots/testutils.nim index 52e8f58f..8c1db0c4 100644 --- a/tests/codex/slots/testutils.nim +++ b/tests/codex/slots/testutils.nim @@ -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 diff --git a/tests/codex/stores/commonstoretests.nim b/tests/codex/stores/commonstoretests.nim index 13b18f50..863b59d4 100644 --- a/tests/codex/stores/commonstoretests.nim +++ b/tests/codex/stores/commonstoretests.nim @@ -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 diff --git a/tests/codex/stores/testcachestore.nim b/tests/codex/stores/testcachestore.nim index c6737ab3..51c59bbf 100644 --- a/tests/codex/stores/testcachestore.nim +++ b/tests/codex/stores/testcachestore.nim @@ -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": diff --git a/tests/codex/stores/testkeyutils.nim b/tests/codex/stores/testkeyutils.nim index ccf368ea..c750df05 100644 --- a/tests/codex/stores/testkeyutils.nim +++ b/tests/codex/stores/testkeyutils.nim @@ -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 diff --git a/tests/codex/stores/testmaintenance.nim b/tests/codex/stores/testmaintenance.nim index 18806721..c050f623 100644 --- a/tests/codex/stores/testmaintenance.nim +++ b/tests/codex/stores/testmaintenance.nim @@ -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 diff --git a/tests/codex/stores/testrepostore.nim b/tests/codex/stores/testrepostore.nim index fabe3444..e58eeb29 100644 --- a/tests/codex/stores/testrepostore.nim +++ b/tests/codex/stores/testrepostore.nim @@ -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 diff --git a/tests/codex/testasyncheapqueue.nim b/tests/codex/testasyncheapqueue.nim index 8df3e44d..10bab65d 100644 --- a/tests/codex/testasyncheapqueue.nim +++ b/tests/codex/testasyncheapqueue.nim @@ -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 diff --git a/tests/codex/testasyncstreamwrapper.nim b/tests/codex/testasyncstreamwrapper.nim index 90aac77f..8a325351 100644 --- a/tests/codex/testasyncstreamwrapper.nim +++ b/tests/codex/testasyncstreamwrapper.nim @@ -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": diff --git a/tests/codex/testchunking.nim b/tests/codex/testchunking.nim index e8186c01..f4f40a29 100644 --- a/tests/codex/testchunking.nim +++ b/tests/codex/testchunking.nim @@ -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": diff --git a/tests/codex/testerasure.nim b/tests/codex/testerasure.nim index 0c7e08a5..dbb6e5f1 100644 --- a/tests/codex/testerasure.nim +++ b/tests/codex/testerasure.nim @@ -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": diff --git a/tests/codex/testindexingstrategy.nim b/tests/codex/testindexingstrategy.nim index 676ede1f..0f9adf90 100644 --- a/tests/codex/testindexingstrategy.nim +++ b/tests/codex/testindexingstrategy.nim @@ -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 diff --git a/tests/codex/testmanifest.nim b/tests/codex/testmanifest.nim index 184bcdd0..4fe39f47 100644 --- a/tests/codex/testmanifest.nim +++ b/tests/codex/testmanifest.nim @@ -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 diff --git a/tests/codex/testpurchasing.nim b/tests/codex/testpurchasing.nim index 3efe92c4..1660cb6a 100644 --- a/tests/codex/testpurchasing.nim +++ b/tests/codex/testpurchasing.nim @@ -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 diff --git a/tests/codex/teststorestream.nim b/tests/codex/teststorestream.nim index 362f1467..eaf92c1d 100644 --- a/tests/codex/teststorestream.nim +++ b/tests/codex/teststorestream.nim @@ -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 diff --git a/tests/codex/testvalidation.nim b/tests/codex/testvalidation.nim index 9891704d..9e4a2dcf 100644 --- a/tests/codex/testvalidation.nim +++ b/tests/codex/testvalidation.nim @@ -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 diff --git a/tests/codex/utils/testasyncstatemachine.nim b/tests/codex/utils/testasyncstatemachine.nim index bd6b355d..a114f7c9 100644 --- a/tests/codex/utils/testasyncstatemachine.nim +++ b/tests/codex/utils/testasyncstatemachine.nim @@ -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 diff --git a/tests/codex/utils/testthen.nim b/tests/codex/utils/testthen.nim index 0b73d9ef..a66e8cd2 100644 --- a/tests/codex/utils/testthen.nim +++ b/tests/codex/utils/testthen.nim @@ -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 = diff --git a/tests/codex/utils/testtimer.nim b/tests/codex/utils/testtimer.nim index d09213ad..303c43fb 100644 --- a/tests/codex/utils/testtimer.nim +++ b/tests/codex/utils/testtimer.nim @@ -8,9 +8,10 @@ ## those terms. import pkg/chronos -import pkg/asynctest import codex/utils/timer + +import ../../asynctest import ../helpers asyncchecksuite "Timer": diff --git a/tests/codex/utils/testtrackedfutures.nim b/tests/codex/utils/testtrackedfutures.nim index 4e3937e5..9274f84f 100644 --- a/tests/codex/utils/testtrackedfutures.nim +++ b/tests/codex/utils/testtrackedfutures.nim @@ -1,6 +1,7 @@ -import pkg/asynctest import pkg/chronos import codex/utils/trackedfutures + +import ../../asynctest import ../helpers type Module = object diff --git a/tests/contracts/testDeployment.nim b/tests/contracts/testDeployment.nim index 525d10ee..d5cb1727 100644 --- a/tests/contracts/testDeployment.nim +++ b/tests/contracts/testDeployment.nim @@ -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 diff --git a/tests/ethertest.nim b/tests/ethertest.nim index 5c620310..8859f714 100644 --- a/tests/ethertest.nim +++ b/tests/ethertest.nim @@ -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 `%` diff --git a/tests/testTaiko.nim b/tests/testTaiko.nim index 137a48fd..49ad3226 100644 --- a/tests/testTaiko.nim +++ b/tests/testTaiko.nim @@ -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 diff --git a/vendor/asynctest b/vendor/asynctest index fe1a34ca..8e2f4e73 160000 --- a/vendor/asynctest +++ b/vendor/asynctest @@ -1 +1 @@ -Subproject commit fe1a34caf572b05f8bdba3b650f1871af9fce31e +Subproject commit 8e2f4e73b97123be0f0041c129942b32df23ecb1