default test name to the filename of the integration test

# Conflicts:
#	tests/testIntegration.nim
This commit is contained in:
Eric 2025-01-13 14:39:07 +11:00
parent 2c31818f39
commit 95021aaa71
No known key found for this signature in database
2 changed files with 34 additions and 19 deletions

View File

@ -30,9 +30,9 @@ type
testTimeout: Duration # individual test timeout
IntegrationTestConfig* = object
startHardhat*: bool
testFile*: string
name*: string
startHardhat: bool
testFile: string
name: string
IntegrationTestStatus = enum ## The status of a test when it is done.
Ok, # tests completed and all succeeded
@ -87,6 +87,21 @@ proc new*(
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) =
if lock.isNil:
lock = newAsyncLock()

View File

@ -17,23 +17,23 @@ import ./integration/testmanager
const TestConfigs =
@[
# IntegrationTestConfig(testFile: "./integration/testcli", startHardhat: true),
# IntegrationTestConfig(testFile: "./integration/testrestapi", startHardhat: true),
# IntegrationTestConfig(testFile: "./integration/testupdownload", startHardhat: true),
# IntegrationTestConfig(testFile: "./integration/testsales", startHardhat: true),
# IntegrationTestConfig(testFile: "./integration/testpurchasing", startHardhat: true),
# IntegrationTestConfig(testFile: "./integration/testblockexpiration", startHardhat: true),
IntegrationTestConfig(
name: "Basic Marketplace and payout tests",
testFile: "./integration/testmarketplace",
startHardhat: true,
IntegrationTestConfig.init("./integration/testcli", startHardhat = true),
IntegrationTestConfig.init("./integration/testrestapi", startHardhat = false),
# IntegrationTestConfig.init("./integration/testupdownload", startHardhat = true),
# IntegrationTestConfig.init("./integration/testsales", startHardhat = true),
# IntegrationTestConfig.init("./integration/testpurchasing", startHardhat = true),
# IntegrationTestConfig.init("./integration/testblockexpiration", startHardhat = true),
# IntegrationTestConfig.init(
# name = "Basic Marketplace and payout tests",
# testFile = "./integration/testmarketplace",
# startHardhat = true,
),
# IntegrationTestConfig(testFile: "./integration/testproofs", startHardhat: true),
# IntegrationTestConfig(testFile: "./integration/testvalidator", startHardhat: true),
IntegrationTestConfig(
name: "Erasure Coding Bug",
testFile: "./integration/testecbug",
startHardhat: true,
# IntegrationTestConfig("./integration/testproofs", startHardhat = true),
# IntegrationTestConfig("./integration/testvalidator", startHardhat = true),
IntegrationTestConfig.init(
name = "Erasure Coding Bug",
testFile = "./integration/testecbug",
startHardhat = true,
)
]