-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[XCM] Observability & Debuggability #6119
Labels
T6-XCM
This PR/Issue is related to XCM.
Comments
Closed
We should be able to add (or extend existing) xcm-emulated tests with
|
This is super required for what we build in novasama.io |
This was referenced Feb 13, 2025
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 24, 2025
# Description This PR introduces a lightweight log-capturing mechanism for XCM unit tests, simplifying debugging by enabling structured log assertions. It partially addresses #6119 and #6125, offering an optional way to verify logs in tests while remaining unobtrusive in normal execution. # Key Changes * [x] Introduces a log capture utility in `sp_tracing`. * [x] Adds XCM test examples demonstrating how and when to use log capturing. # Review Notes: * The log capture mechanism is opt-in and does not affect existing tests unless explicitly used. * The implementation is minimal and does not add complexity to existing test setups. * It provides a structured alternative to [`sp_tracing::init_for_tests()`](https://paritytech.github.io/polkadot-sdk/master/sp_tracing/fn.init_for_tests.html) for log verification in automated tests. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This was referenced Feb 24, 2025
github-merge-queue bot
pushed a commit
that referenced
this issue
Feb 28, 2025
A follow-up PR to simplify event assertions by introducing `contains_event`, allowing event checks without needing exact field matches. This reduces redundancy and makes tests more flexible. Partially addresses #6119 by providing an alternative way to assert events. Reference: [PR #7594 - Discussion](#7594 (comment)) --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this issue
Mar 6, 2025
This PR enhances **`test_log_capture`**, ensuring logs are **captured for assertions** and **printed to the console** during test execution. ## **Motivation** - Partially addresses #6119 and #6125, to improves developer **tracing and debugging** in XCM-related tests. - Builds on #7594, improving **log visibility** while maintaining test **log capture capabilities**. - While writing tests for #7234, I noticed this function was missing. This PR adds it to streamline log handling in unit tests. ## **Changes** - Ensures logs up to `TRACE` level are **captured** (for assertions) and **printed** (for visibility). - Refines documentation to clearly specify **when to use** each function. - **Removes ANSI escape codes** from captured logs to ensure clean, readable assertions. ## **When to Use?** | Usage | Captures Logs? | Prints Logs? | Example | |----------------------------------------------|-----------------|--------------|-----------------------------------------------| | `init_log_capture(LevelFilter::INFO, false)` | ✅ Yes | ❌ No | Capture logs for assertions without printing. | | `init_log_capture(LevelFilter::TRACE, true)` | ✅ Yes | ✅ Yes | Capture logs and print them in test output. | | `sp_tracing::init_for_tests()` | ❌ No | ✅ Yes | Print logs to the console without capturing. | --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Message Tracking
Make XCM messages easier to trace:
SetTopic
in the same way,topic
with localmessage_id
and emit event so that indexers can quickly triage messages and categorize them into cross-chain flows.Debuggability
ProcessXcmMessage
/XcmExecutor
emitting an event on failure. #2780polkadot-docs
, e.g. https://franciscoaguirre.github.io/polkadot-dry-runner/polkadot-docs
,target: xcm
including error condition specifics and context,Debug
forAccountId
ayevbeosa/polkadot-sdk#1Developer tracing
Related sub-issues:
messageQueue
not showing Error whensuccess
is no #478The text was updated successfully, but these errors were encountered: