Add build test with chronicles to json enabled (#215)

* Add build test with chronicles to json enabled

* Fix windows failing test
This commit is contained in:
andri lim 2024-02-19 13:47:40 +07:00 committed by GitHub
parent 514049a287
commit 9c65df3053
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 11 deletions

View File

@ -47,16 +47,14 @@ proc run(args, path: string) =
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:refc -r", path
proc buildBinary(name: string, srcDir = "./", params = "", cmdParams = "") =
if not dirExists "build":
mkDir "build"
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") &
" -r -f --skipUserCfg:on --skipParentCfg:on --verbosity:0" &
" --debuginfo --path:'.' --threads:on -d:chronicles_log_level=ERROR" &
" --styleCheck:usages --styleCheck:hint" &
" --hint[XDeclaredButNotUsed]:off --hint[Processing]:off " &
" --out:./build/" & name & " " & params & " " & srcDir & name & ".nim" &
" " & cmdParams
proc buildOnly(args, path: string) =
build args, path
if (NimMajor, NimMinor) > (1, 6):
build args & " --mm:refc -r", path
task test, "run tests":
run "", "tests/all"
when not defined(windows):
# on windows, socker server build failed
buildOnly "-d:\"chronicles_sinks=textlines[dynamic],json[dynamic]\"", "tests/all"

View File

@ -110,7 +110,7 @@ proc processData(client: RpcSocketClient) {.async: (raises: []).} =
# async loop reconnection and waiting
try:
info "Reconnect to server", address=client.address
info "Reconnect to server", address=`$`(client.address)
client.transport = await connect(client.address)
except TransportError as exc:
error "Error when reconnecting to server", msg=exc.msg