refactor: debug and logging
- Move test manager values to config object
- Increase codex port separation (between api and disc ports) in an attempt to prevent overlap across tests (ie Test1: api=8000(tcp), disc=9000(udp), and Test2: api=9000(tcp), disc=10000(udp))
- print stderr when exitcode == 1 if there's < 3 lines of stdout
- Logging:
- Always write test manager harness chronicles logs to file, ie testmanager.chronicles.log in the root of the `integration/logs/<run name>` dir
- Always write individual test stdout to file, ie `<test file name>.stdout.log` in the root of the `integration/logs/<run name>/<test file name>` dir
- On error, print stderr to screen and write stderr to file. Or on failure, if stdout is sufficiently short, write stderr to screen and file in `integration/logs/<run name>/<test file name>/<test file name>.stderr.log`
- When debugging, ie DebugCodexNodes == true
- Removes DebugTestHarness from controlling anything other than printing chronicles output from the testmanager to the terminal
- Now, if DebugCodexNodes is set to true:
- Codex node (chronicles) output for multinodesuite tests is logged to file, eg `integration/logs/<run name>/<test file name>/<test name>/<role>_<idx>.log`
- Codex chronicles output is logged to stdout, which also written to file (see above)
2025-03-06 15:49:08 +11:00
|
|
|
import std/os
|
2025-11-05 18:00:43 +11:00
|
|
|
import std/strutils
|
|
|
|
|
import ./imports
|
2022-05-18 14:31:45 +02:00
|
|
|
|
2025-11-05 18:00:43 +11:00
|
|
|
## Limit which integration tests to run by setting the
|
|
|
|
|
## environment variable during compilation. For example:
|
|
|
|
|
## CODEX_INTEGRATION_TEST_INCLUDES="testFoo.nim,testBar.nim"
|
|
|
|
|
const includes = getEnv("CODEX_INTEGRATION_TEST_INCLUDES")
|
2025-03-05 15:16:07 +11:00
|
|
|
|
2025-11-05 18:00:43 +11:00
|
|
|
when includes != "":
|
|
|
|
|
# import only the specified tests
|
|
|
|
|
importAll(includes.split(","))
|
|
|
|
|
else:
|
|
|
|
|
# import all tests in the integration/ directory
|
|
|
|
|
importTests(currentSourcePath().parentDir() / "integration")
|
2025-03-05 15:16:07 +11:00
|
|
|
|
2025-11-05 18:00:43 +11:00
|
|
|
{.warning[UnusedImport]: off.}
|