mirror of
https://github.com/status-im/nim-codex.git
synced 2025-01-24 01:30:59 +00:00
allow test parameters to be set from make testIntegration command
This commit is contained in:
parent
2faf617538
commit
efd960fc7e
20
Makefile
20
Makefile
@ -141,10 +141,28 @@ testContracts: | build deps
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim testContracts $(NIM_PARAMS) build.nims
|
||||
|
||||
TEST_PARAMS :=
|
||||
ifdef DEBUG_TESTHARNESS
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:DebugTestHarness=$(DEBUG_TESTHARNESS)
|
||||
endif
|
||||
ifdef DEBUG_HARDHAT
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:DebugHardhat=$(DEBUG_HARDHAT)
|
||||
endif
|
||||
ifdef DEBUG_CODEXNODES
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:DebugCodexNodes=$(DEBUG_CODEXNODES)
|
||||
endif
|
||||
ifdef DEBUG_UPDATES
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:ShowContinuousStatusUpdates=$(DEBUG_UPDATES)
|
||||
endif
|
||||
ifdef TEST_TIMEOUT
|
||||
TEST_PARAMS := $(TEST_PARAMS) -d:TestTimeout=$(TEST_TIMEOUT)
|
||||
endif
|
||||
|
||||
# Builds and runs the integration tests
|
||||
testIntegration: | build deps
|
||||
echo TEST PARAMS: $(TEST_PARAMS)
|
||||
echo -e $(BUILD_MSG) "build/$@" && \
|
||||
$(ENV_SCRIPT) nim testIntegration $(NIM_PARAMS) build.nims
|
||||
$(ENV_SCRIPT) nim testIntegration $(TEST_PARAMS) $(NIM_PARAMS) build.nims
|
||||
|
||||
# Builds and runs all tests (except for Taiko L2 tests)
|
||||
testAll: | build deps
|
||||
|
@ -30,23 +30,23 @@ const TestConfigs =
|
||||
IntegrationTestConfig.init("./integration/testecbug", startHardhat = true)
|
||||
]
|
||||
|
||||
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
|
||||
# Shows test status updates at time intervals. Useful for running locally with
|
||||
# active terminal interaction. Set to false for unattended runs, eg CI.
|
||||
const showContinuousStatusUpdates = false
|
||||
# Timeout duration for EACH integration test file.
|
||||
const testTimeout = 60.minutes
|
||||
# Echoes stderr if there's a test failure (eg test failed, compilation error)
|
||||
# or error (eg test manager error)
|
||||
const DebugTestHarness {.booldefine.} = false
|
||||
# Echoes stdout from Hardhat process
|
||||
const DebugHardhat {.booldefine.} = 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 {.booldefine.} = true
|
||||
# Shows test status updates at time intervals. Useful for running locally with
|
||||
# active terminal interaction. Set to false for unattended runs, eg CI.
|
||||
const ShowContinuousStatusUpdates {.booldefine.} = false
|
||||
# Timeout duration (in mimutes) for EACH integration test file.
|
||||
const TestTimeout {.intdefine.} = 60
|
||||
|
||||
when debugTestHarness and enabledLogLevel != LogLevel.TRACE:
|
||||
proc run() {.async.} =
|
||||
when DebugTestHarness and enabledLogLevel != LogLevel.TRACE:
|
||||
styledEcho bgWhite,
|
||||
fgBlack, styleBright, "\n\n ", styleUnderscore,
|
||||
"ADDITIONAL LOGGING AVAILABILE\n\n", resetStyle, bgWhite, fgBlack, styleBright,
|
||||
@ -56,7 +56,7 @@ proc run() {.async.} =
|
||||
resetStyle, bgWhite, fgBlack,
|
||||
"\n\n nim c -d:chronicles_log_level=TRACE -r ./testIntegration.nim\n\n"
|
||||
|
||||
when debugCodexNodes:
|
||||
when DebugCodexNodes:
|
||||
styledEcho bgWhite,
|
||||
fgBlack, styleBright, "\n\n ", styleUnderscore, "ENABLE CODEX LOGGING\n\n",
|
||||
resetStyle, bgWhite, fgBlack, styleBright,
|
||||
@ -68,11 +68,11 @@ proc run() {.async.} =
|
||||
|
||||
let manager = TestManager.new(
|
||||
configs = TestConfigs,
|
||||
debugTestHarness,
|
||||
debugHardhat,
|
||||
debugCodexNodes,
|
||||
showContinuousStatusUpdates,
|
||||
testTimeout,
|
||||
DebugTestHarness,
|
||||
DebugHardhat,
|
||||
DebugCodexNodes,
|
||||
ShowContinuousStatusUpdates,
|
||||
TestTimeout.minutes,
|
||||
)
|
||||
try:
|
||||
trace "starting test manager"
|
||||
|
Loading…
x
Reference in New Issue
Block a user