atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

feat(tests): allow RUST_LOG with multiple tags for native executables

Open dimxy opened this issue 8 months ago • 1 comments

This PR removes unneeded RUST_LOG parsing for test mm2 startup code, native platform, in the test_mm_start fn (it failed when RUST_LOG had multiple tags). This code change allows to use arbitrary RUST_LOG, with multiple tags (like RUST_LOG=off or RUST_LOG="debug,libp2p_gossipsub=info,rustls=error,mm2_main::database=error,mm2_p2p=info,multistream_select=error") for native mm2 executable in docker and other tests.

The fix ensures the p2p module has info log level (needed for wait_for_log fn, used in tests). The fix also refactors the check_seednodes test fn: instead of waiting for Completed IAmrelay debug message (not available if debug=off) it queries get_directly_connected_peers RPC to ensure a remote peer is connected.

This PR should be useful to hide unneeded debug logs, while developing tests running mm2 executables. (Please note that some tests in docker_ordermatch_tests or tendermint_tests modules still need libp2p DEBUG logs.)

dimxy avatar May 12 '25 07:05 dimxy

I suggest removing log dumps inside run_taker_node run_maker_node run_watcher_node in swap_watcher_tests.rs: (https://github.com/KomodoPlatform/komodo-defi-framework/pull/2452/commits/864e7e57af845d6d85fa42d74d5fccd1ebf92112). They dump incomplete logs (before tests calling them finish), so in fact misleading. Instead we should create log dumps in test functions, if needed.

dimxy avatar May 12 '25 17:05 dimxy