diff --git a/tests/integration/multinodes.nim b/tests/integration/multinodes.nim index a0a45b3b..72afe5ae 100644 --- a/tests/integration/multinodes.nim +++ b/tests/integration/multinodes.nim @@ -68,8 +68,6 @@ template withLock(lock: AsyncLock, body: untyped) = except AsyncLockError as parent: raiseMultiNodeSuiteError "lock error", parent - - template multinodesuite*(name: string, body: untyped) = asyncchecksuite name: # Following the problem described here: @@ -163,9 +161,7 @@ template multinodesuite*(name: string, body: untyped) = raiseMultiNodeSuiteError "Cannot start node at nodeIdx " & $nodeIdx & ", not enough eth accounts." - let datadir = - getTempDir() / "Codex" / sanitize(TestId) / sanitize(currentTestName) / - sanitize($starttime) / sanitize($role & "_" & $roleIdx) + let datadir = getDataDir(TestId, currentTestName, $starttime, $role, some roleIdx) try: if config.logFile.isSome or CodexLogToFile: diff --git a/tests/integration/utils.nim b/tests/integration/utils.nim index c30e9a11..3e522a04 100644 --- a/tests/integration/utils.nim +++ b/tests/integration/utils.nim @@ -82,3 +82,11 @@ when defined(windows): let cmd = &"{absolutePath(path)} kill {processName} \"{matchingCriteria}\"" trace "Forcefully killing windows process", processName, matchingCriteria, cmd return await execCommandEx(cmd, timeout = 5.seconds) + +proc getDataDir*(testId, testName, startTime, role: string, index = int.none): string = + var suffix = role + if idx =? index: + suffix &= "_" & $idx + + getTempDir() / "Codex" / sanitize(testId) / sanitize(testName) / sanitize(startTime) / + sanitize(suffix) diff --git a/tests/testIntegration.nim b/tests/testIntegration.nim index 8220898f..b2253427 100644 --- a/tests/testIntegration.nim +++ b/tests/testIntegration.nim @@ -124,3 +124,4 @@ when isMainModule: import ./integration/testproofs import ./integration/testvalidator import ./integration/testecbug + import ./integration/testrestapivalidation