CI: build binaries with TRACE & JSON logs (#268)
Also: remove unused imports.
This commit is contained in:
parent
c6c2d99907
commit
b8b0a2b4bc
|
@ -17,12 +17,15 @@ requires "nim >= 1.2.0",
|
|||
"stew >= 0.1.0"
|
||||
|
||||
proc runTest(filename: string, verify: bool = true, sign: bool = true) =
|
||||
var excstr = "nim c -r --opt:speed -d:debug --verbosity:0 --hints:off -d:chronicles_log_level=info"
|
||||
var excstr = "nim c --opt:speed -d:debug --verbosity:0 --hints:off"
|
||||
excstr.add(" --warning[CaseTransition]:off --warning[ObservableStores]:off --warning[LockLevel]:off")
|
||||
excstr.add(" -d:libp2p_pubsub_sign=" & $sign)
|
||||
excstr.add(" -d:libp2p_pubsub_verify=" & $verify)
|
||||
excstr.add(" tests/" & filename)
|
||||
exec excstr
|
||||
if verify and sign:
|
||||
# build it with TRACE and JSON logs
|
||||
exec excstr & " -d:chronicles_log_level=TRACE -d:chronicles_sinks:json" & " tests/" & filename
|
||||
# build it again, to run it with less verbose logs
|
||||
exec excstr & " -d:chronicles_log_level=INFO -r" & " tests/" & filename
|
||||
rmFile "tests/" & filename.toExe
|
||||
|
||||
proc buildSample(filename: string) =
|
||||
|
|
|
@ -11,7 +11,6 @@ import strutils
|
|||
import chronos, chronicles, stew/byteutils
|
||||
import stream/connection,
|
||||
vbuffer,
|
||||
errors,
|
||||
protocols/protocol
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -14,8 +14,6 @@ import types,
|
|||
nimcrypto/utils,
|
||||
../../stream/connection,
|
||||
../../stream/bufferstream,
|
||||
../../utility,
|
||||
../../errors,
|
||||
../../peerinfo
|
||||
|
||||
export connection
|
||||
|
|
|
@ -13,7 +13,6 @@ import ../muxer,
|
|||
../../stream/connection,
|
||||
../../stream/bufferstream,
|
||||
../../utility,
|
||||
../../errors,
|
||||
../../peerinfo,
|
||||
coder,
|
||||
types,
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
import chronos, chronicles
|
||||
import ../protocols/protocol,
|
||||
../stream/connection,
|
||||
../peerinfo,
|
||||
../errors
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -15,9 +15,7 @@ import pubsub,
|
|||
rpc/[messages, message],
|
||||
../../stream/connection,
|
||||
../../peerid,
|
||||
../../peerinfo,
|
||||
../../utility,
|
||||
../../errors
|
||||
../../peerinfo
|
||||
|
||||
logScope:
|
||||
topics = "floodsub"
|
||||
|
|
|
@ -7,9 +7,8 @@
|
|||
## This file may not be copied, modified, or distributed except according to
|
||||
## those terms.
|
||||
|
||||
import oids
|
||||
import chronos, chronicles
|
||||
import connection, ../utility
|
||||
import connection
|
||||
|
||||
logScope:
|
||||
topics = "chronosstream"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
import tables,
|
||||
sequtils,
|
||||
options,
|
||||
strformat,
|
||||
sets,
|
||||
algorithm,
|
||||
oids
|
||||
|
@ -20,18 +19,15 @@ import chronos,
|
|||
metrics
|
||||
|
||||
import stream/connection,
|
||||
stream/chronosstream,
|
||||
transports/transport,
|
||||
multistream,
|
||||
multiaddress,
|
||||
protocols/protocol,
|
||||
protocols/secure/secure,
|
||||
protocols/secure/plaintext, # for plain text
|
||||
peerinfo,
|
||||
protocols/identify,
|
||||
protocols/pubsub/pubsub,
|
||||
muxers/muxer,
|
||||
errors,
|
||||
peerid
|
||||
|
||||
logScope:
|
||||
|
|
|
@ -16,9 +16,6 @@ import transport,
|
|||
../stream/connection,
|
||||
../stream/chronosstream
|
||||
|
||||
when chronicles.enabledLogLevel == LogLevel.TRACE:
|
||||
import oids
|
||||
|
||||
logScope:
|
||||
topics = "tcptransport"
|
||||
|
||||
|
@ -74,7 +71,7 @@ proc connHandler*(t: TcpTransport,
|
|||
proc cleanup() {.async.} =
|
||||
try:
|
||||
await client.join()
|
||||
trace "cleaning up client", addrs = client.remoteAddress, connoid = conn.oid
|
||||
trace "cleaning up client", addrs = $client.remoteAddress, connoid = conn.oid
|
||||
if not(isNil(conn)):
|
||||
await conn.close()
|
||||
t.clients.keepItIf(it != client)
|
||||
|
|
|
@ -7,12 +7,11 @@
|
|||
## This file may not be copied, modified, or distributed except according to
|
||||
## those terms.
|
||||
|
||||
import sequtils, tables
|
||||
import sequtils
|
||||
import chronos, chronicles
|
||||
import ../stream/connection,
|
||||
../multiaddress,
|
||||
../multicodec,
|
||||
../errors
|
||||
../multicodec
|
||||
|
||||
type
|
||||
ConnHandler* = proc (conn: Connection): Future[void] {.gcsafe.}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
{.used.}
|
||||
|
||||
import unittest, sequtils, options, tables, sets
|
||||
import unittest, sequtils, options, tables
|
||||
import chronos, stew/byteutils
|
||||
import utils,
|
||||
../../libp2p/[errors,
|
||||
|
@ -18,8 +18,7 @@ import utils,
|
|||
crypto/crypto,
|
||||
protocols/pubsub/pubsub,
|
||||
protocols/pubsub/floodsub,
|
||||
protocols/pubsub/rpc/messages,
|
||||
protocols/pubsub/rpc/message]
|
||||
protocols/pubsub/rpc/messages]
|
||||
|
||||
import ../helpers
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import unittest, strutils, sequtils, strformat, stew/byteutils
|
||||
import unittest, strutils, strformat, stew/byteutils
|
||||
import chronos
|
||||
import ../libp2p/errors,
|
||||
../libp2p/multistream,
|
||||
|
|
|
@ -9,19 +9,13 @@ import ../libp2p/[errors,
|
|||
multistream,
|
||||
standard_setup,
|
||||
stream/bufferstream,
|
||||
protocols/identify,
|
||||
stream/connection,
|
||||
transports/transport,
|
||||
transports/tcptransport,
|
||||
multiaddress,
|
||||
peerinfo,
|
||||
crypto/crypto,
|
||||
protocols/protocol,
|
||||
muxers/muxer,
|
||||
muxers/mplex/mplex,
|
||||
muxers/mplex/types,
|
||||
protocols/secure/secio,
|
||||
protocols/secure/secure,
|
||||
stream/lpstream]
|
||||
import ./helpers
|
||||
|
||||
|
|
Loading…
Reference in New Issue