mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-10 03:55:30 +00:00
cleanup
# Conflicts: # tests/testIntegration.nim
This commit is contained in:
parent
3846ae08a0
commit
bfbb22b7b5
@ -25,11 +25,17 @@ type
|
|||||||
lastHardhatPort: int
|
lastHardhatPort: int
|
||||||
lastCodexApiPort: int
|
lastCodexApiPort: int
|
||||||
lastCodexDiscPort: int
|
lastCodexDiscPort: int
|
||||||
debugTestHarness: bool # output chronicles logs for the manager and multinodes harness
|
# Echoes stderr if there's a test failure (eg test failed, compilation
|
||||||
|
# error) or error (eg test manager error)
|
||||||
|
debugTestHarness: bool
|
||||||
|
# Echoes stdout from Hardhat process
|
||||||
debugHardhat: bool
|
debugHardhat: bool
|
||||||
debugCodexNodes: bool # output chronicles logs for the codex nodes running in the tests
|
# Echoes stdout from the integration test file process. Codex process logs
|
||||||
timeStart: Moment
|
# can also be output if a test uses a multinodesuite, requires
|
||||||
timeEnd: Moment
|
# CodexConfig.debug to be enabled
|
||||||
|
debugCodexNodes: bool
|
||||||
|
timeStart: ?Moment
|
||||||
|
timeEnd: ?Moment
|
||||||
codexPortLock: AsyncLock
|
codexPortLock: AsyncLock
|
||||||
hardhatPortLock: AsyncLock
|
hardhatPortLock: AsyncLock
|
||||||
hardhatProcessLock: AsyncLock
|
hardhatProcessLock: AsyncLock
|
||||||
@ -92,25 +98,6 @@ proc new*(
|
|||||||
debugCodexNodes = false,
|
debugCodexNodes = false,
|
||||||
testTimeout = 60.minutes): TestManager =
|
testTimeout = 60.minutes): TestManager =
|
||||||
|
|
||||||
if debugTestHarness:
|
|
||||||
when enabledLogLevel != LogLevel.TRACE:
|
|
||||||
echoStyled bgWhite, fgBlack, styleBright, "\n\n ",
|
|
||||||
styleUnderscore, "ADDITIONAL LOGGING AVAILABILE\n\n",
|
|
||||||
resetStyle, bgWhite, fgBlack, styleBright, """
|
|
||||||
More integration test harness logs available by running with
|
|
||||||
-d:chronicles_log_level=TRACE, eg:""",
|
|
||||||
resetStyle, bgWhite, fgBlack,
|
|
||||||
"\n\n nim c -d:chronicles_log_level=TRACE -r ./testIntegration.nim\n\n"
|
|
||||||
|
|
||||||
if debugCodexNodes:
|
|
||||||
echoStyled bgWhite, fgBlack, styleBright, "\n\n ",
|
|
||||||
styleUnderscore, "ENABLE CODEX LOGGING\n\n",
|
|
||||||
resetStyle, bgWhite, fgBlack, styleBright, """
|
|
||||||
For integration test suites that are multinodesuites, or for
|
|
||||||
tests launching a CodexProcess, ensure that CodexConfig.debug
|
|
||||||
is enabled.
|
|
||||||
"""
|
|
||||||
|
|
||||||
TestManager(
|
TestManager(
|
||||||
configs: configs,
|
configs: configs,
|
||||||
lastHardhatPort: 8545,
|
lastHardhatPort: 8545,
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
# import ./integration/testvalidator
|
# import ./integration/testvalidator
|
||||||
# import ./integration/testecbug
|
# import ./integration/testecbug
|
||||||
|
|
||||||
|
import std/terminal
|
||||||
import pkg/chronos
|
import pkg/chronos
|
||||||
import pkg/codex/logutils
|
import pkg/codex/logutils
|
||||||
import ./integration/testmanager
|
import ./integration/testmanager
|
||||||
@ -18,33 +19,54 @@ import ./integration/testmanager
|
|||||||
const TestConfigs =
|
const TestConfigs =
|
||||||
@[
|
@[
|
||||||
IntegrationTestConfig.init("./integration/testcli", startHardhat = true),
|
IntegrationTestConfig.init("./integration/testcli", startHardhat = true),
|
||||||
IntegrationTestConfig.init("./integration/testrestapi", startHardhat = false),
|
IntegrationTestConfig.init("./integration/testrestapi", startHardhat = true),
|
||||||
# IntegrationTestConfig.init("./integration/testupdownload", startHardhat = true),
|
IntegrationTestConfig.init("./integration/testupdownload", startHardhat = true),
|
||||||
# IntegrationTestConfig.init("./integration/testsales", startHardhat = true),
|
IntegrationTestConfig.init("./integration/testsales", startHardhat = true),
|
||||||
# IntegrationTestConfig.init("./integration/testpurchasing", startHardhat = true),
|
IntegrationTestConfig.init("./integration/testpurchasing", startHardhat = true),
|
||||||
# IntegrationTestConfig.init("./integration/testblockexpiration", startHardhat = true),
|
IntegrationTestConfig.init("./integration/testblockexpiration", startHardhat = true),
|
||||||
# IntegrationTestConfig.init(
|
IntegrationTestConfig.init("./integration/testmarketplace", startHardhat = true),
|
||||||
# name = "Basic Marketplace and payout tests",
|
IntegrationTestConfig.init("./integration/testproofs", startHardhat = true),
|
||||||
# testFile = "./integration/testmarketplace",
|
IntegrationTestConfig.init("./integration/testvalidator", startHardhat = true),
|
||||||
# startHardhat = true,
|
IntegrationTestConfig.init("./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,
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
proc run() {.async.} =
|
proc run() {.async.} =
|
||||||
|
# Echoes stderr if there's a test failure (eg test failed, compilation error)
|
||||||
|
# or error (eg test manager error)
|
||||||
|
const debugTestHarness = false
|
||||||
|
# Echoes stdout from Hardhat process
|
||||||
|
const debugHardhat = false
|
||||||
|
# Echoes stdout from the integration test file process. Codex process logs can
|
||||||
|
# also be output if a test uses a multinodesuite, requires CodexConfig.debug
|
||||||
|
# to be enabled
|
||||||
|
const debugCodexNodes = true
|
||||||
|
|
||||||
|
when debugTestHarness and enabledLogLevel != LogLevel.TRACE:
|
||||||
|
styledEcho bgWhite,
|
||||||
|
fgBlack, styleBright, "\n\n ", styleUnderscore,
|
||||||
|
"ADDITIONAL LOGGING AVAILABILE\n\n", resetStyle, bgWhite, fgBlack, styleBright,
|
||||||
|
"""
|
||||||
|
More integration test harness logs available by running with
|
||||||
|
-d:chronicles_log_level=TRACE, eg:""",
|
||||||
|
resetStyle, bgWhite, fgBlack,
|
||||||
|
"\n\n nim c -d:chronicles_log_level=TRACE -r ./testIntegration.nim\n\n"
|
||||||
|
|
||||||
|
when debugCodexNodes:
|
||||||
|
styledEcho bgWhite,
|
||||||
|
fgBlack, styleBright, "\n\n ", styleUnderscore, "ENABLE CODEX LOGGING\n\n",
|
||||||
|
resetStyle, bgWhite, fgBlack, styleBright,
|
||||||
|
"""
|
||||||
|
For integration test suites that are multinodesuites, or for
|
||||||
|
tests launching a CodexProcess, ensure that CodexConfig.debug
|
||||||
|
is enabled.
|
||||||
|
"""
|
||||||
|
|
||||||
let manager = TestManager.new(
|
let manager = TestManager.new(
|
||||||
configs = TestConfigs,
|
configs = TestConfigs,
|
||||||
debugTestHarness = true,
|
debugTestHarness,
|
||||||
# Echos stderr if there's a test failure or error (error in running the test)
|
debugHardhat,
|
||||||
debugCodexNodes = true,
|
debugCodexNodes,
|
||||||
# Echos stdout from the Codex process (chronicles logs). If test uses a multinodesuite, requires CodexConfig.debug to be enabled
|
testTimeout = 60.minutes,
|
||||||
debugHardhat = false,
|
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
trace "starting test manager"
|
trace "starting test manager"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user