mirror of
https://github.com/status-im/nim-codex.git
synced 2025-02-01 05:27:18 +00:00
default test name to the filename of the integration test
# Conflicts: # tests/testIntegration.nim
This commit is contained in:
parent
2c31818f39
commit
95021aaa71
@ -30,9 +30,9 @@ type
|
|||||||
testTimeout: Duration # individual test timeout
|
testTimeout: Duration # individual test timeout
|
||||||
|
|
||||||
IntegrationTestConfig* = object
|
IntegrationTestConfig* = object
|
||||||
startHardhat*: bool
|
startHardhat: bool
|
||||||
testFile*: string
|
testFile: string
|
||||||
name*: string
|
name: string
|
||||||
|
|
||||||
IntegrationTestStatus = enum ## The status of a test when it is done.
|
IntegrationTestStatus = enum ## The status of a test when it is done.
|
||||||
Ok, # tests completed and all succeeded
|
Ok, # tests completed and all succeeded
|
||||||
@ -87,6 +87,21 @@ proc new*(
|
|||||||
testTimeout: testTimeout
|
testTimeout: testTimeout
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init*(
|
||||||
|
_: type IntegrationTestConfig,
|
||||||
|
testFile: string,
|
||||||
|
startHardhat: bool,
|
||||||
|
name = ""): IntegrationTestConfig =
|
||||||
|
|
||||||
|
IntegrationTestConfig(
|
||||||
|
testFile: testFile,
|
||||||
|
name: if name == "":
|
||||||
|
testFile.extractFilename
|
||||||
|
else:
|
||||||
|
name,
|
||||||
|
startHardhat: startHardhat
|
||||||
|
)
|
||||||
|
|
||||||
template withLock*(lock: AsyncLock, body: untyped) =
|
template withLock*(lock: AsyncLock, body: untyped) =
|
||||||
if lock.isNil:
|
if lock.isNil:
|
||||||
lock = newAsyncLock()
|
lock = newAsyncLock()
|
||||||
|
@ -17,23 +17,23 @@ import ./integration/testmanager
|
|||||||
|
|
||||||
const TestConfigs =
|
const TestConfigs =
|
||||||
@[
|
@[
|
||||||
# IntegrationTestConfig(testFile: "./integration/testcli", startHardhat: true),
|
IntegrationTestConfig.init("./integration/testcli", startHardhat = true),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testrestapi", startHardhat: true),
|
IntegrationTestConfig.init("./integration/testrestapi", startHardhat = false),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testupdownload", startHardhat: true),
|
# IntegrationTestConfig.init("./integration/testupdownload", startHardhat = true),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testsales", startHardhat: true),
|
# IntegrationTestConfig.init("./integration/testsales", startHardhat = true),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testpurchasing", startHardhat: true),
|
# IntegrationTestConfig.init("./integration/testpurchasing", startHardhat = true),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testblockexpiration", startHardhat: true),
|
# IntegrationTestConfig.init("./integration/testblockexpiration", startHardhat = true),
|
||||||
IntegrationTestConfig(
|
# IntegrationTestConfig.init(
|
||||||
name: "Basic Marketplace and payout tests",
|
# name = "Basic Marketplace and payout tests",
|
||||||
testFile: "./integration/testmarketplace",
|
# testFile = "./integration/testmarketplace",
|
||||||
startHardhat: true,
|
# startHardhat = true,
|
||||||
),
|
),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testproofs", startHardhat: true),
|
# IntegrationTestConfig("./integration/testproofs", startHardhat = true),
|
||||||
# IntegrationTestConfig(testFile: "./integration/testvalidator", startHardhat: true),
|
# IntegrationTestConfig("./integration/testvalidator", startHardhat = true),
|
||||||
IntegrationTestConfig(
|
IntegrationTestConfig.init(
|
||||||
name: "Erasure Coding Bug",
|
name = "Erasure Coding Bug",
|
||||||
testFile: "./integration/testecbug",
|
testFile = "./integration/testecbug",
|
||||||
startHardhat: true,
|
startHardhat = true,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user