-
Notifications
You must be signed in to change notification settings - Fork 353
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
Add more debug output from multi-test #575
Comments
I'd rather not use In general, ability to turn all logging, or for example log all submessages on debug level and others only on error. |
@uint I see you've assigned youself here - could you share your vision/approach? |
I don't have one yet. I was going to first try and reproduce the situations when errors happen and the output is confusing (I'm guessing any multitests with a bunch of nested contract -> contract calls?), poke at how multitest/cosmwasm_std mocks work, etc. Basically I need to understand the issue better.
Since we use If you already have ideas about this and wanted to tackle it, I can pass it on and work on something else. I was only starting to look at this. |
Nah, I'm actually curious.
I remember that I struggled a lot for example when I was introducing migration into |
Ahhh, I think @hashedone had a similar problem. Thanks for that. It sounds annoying. |
Something like this is possible by making the multitest lib attach context to errors.
I kind of like the approach of giving errors more information, but I have two concerns to figure out:
Would you still want logs, too? Or prefer logs over this? |
But this is debug? Those are opt-in, so I wouldn't worry about prettines if they are giving more valueable info. And I don't quite get the second point, you mean that logs are crossing each other? Best if you could attach some dumps.
If this could be an option to enable I wouldn't mind to have that context anyway. |
Actually, I just pushed a draft PR to show you what I'm doing. I'll explain there. #597 |
Great solution for execute. We should support at least query and instantiate as well. (More complex ones can be added in as-needed follow-ups). #597 (comment) |
When you say "support instantiate", do you mean situations when a contract instantiates another contract from a code id? |
Yup. Both that and when an instantiate call triggers another call (like execute or instantiate) Instantiate and Query calls are not wrapped in a context afaik. |
The
I did that in the final commit in that PR (just before merging) since it was really simple to add and looked more consistent. But not all the possible situations are tested. |
Ah, I didn't see that. Let me look again at the merged PR |
You are right. It was done, I will close this. I did see some other minor cleanup you can make in a follow-up PR if you think it is relevant. But this issue is closed 👍 |
It can be hard to track down failures, especially when they happen in multiple levels of submessages. Getting the full backtrace can be helpful, but it seems I am the only one who can really parse those to see what the issue was.
The main info I pull out is what the messages are and which depth of the submessages we are at. We can add some
dbg!()
statements to the framework... maybe when each message is executed, when each submessage is executed, each query is called, etc. basically all contract -> contract interactions could be traced.Since multi-test only compiles for test environments (not into wasm), we can just dump everything with debug logs. Maybe we have some way to configure how many/which logs to dump, but first let's make sure we have all the needed info there, then make it optional.
The text was updated successfully, but these errors were encountered: