-
Notifications
You must be signed in to change notification settings - Fork 84
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
[WIP] Truncate stacktrace once the first kaocha ns is encountered #321
Conversation
Codecov ReportBase: 75.47% // Head: 75.52% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
==========================================
+ Coverage 75.47% 75.52% +0.04%
==========================================
Files 51 51
Lines 2732 2737 +5
Branches 255 255
==========================================
+ Hits 2062 2067 +5
Misses 510 510
Partials 160 160
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
On a quick skim it seems reasonable. Could you maybe paste in an example here of the output before and after this patch? Would there be a way to opt-out of this behavior? With stuff like this (see also e.g. output-capturing, or the elision behavior we have now) I think it's important to be able to opt-out completely in case there's a concern that this cleverness is getting in people's way. |
before76 lines
after12 lines
|
Totally agree, for some cases - e.g. working on kaocha itself - it might be preferable to see the full trace. What type of option would you prefer? Plugin? Command-line switch? Any existing switch to model this on? One possibility is to have two printers:
Then the user can select a printer using a command line switch, defaulting to kaocha.stacktrace/print-short-cause-trace This would also allow the user to supply their own printer, without having to modify kaocha code. |
With the optional support, we could do "staged rollout": it could start out as optional and then be promoted to default when people like it |
It seems like a unit test would be awkward with the current architecture since it's printing to the terminal. Or did you just want to test Using a printer system would be an elegant solution if users want to write their own stacktrace printer. I'm not sure how often they do. (But perhaps if we had good documentation, they would?) |
a569099
to
4e9e7e2
Compare
Closing in favor of #420 |
Fixes #58
This PR stops printing stacktraces when the first in a list of sentinels (kaocha stackframes) is encountered. Everything after that point is noise, as it doesn't pertain to the current project.
I had to scroll up on every test failure because the whole trace didn't fit in my terminal. This PR works for my small project so far, but haven't tested it extensively.
Marked as WIP because I'm not sure about a few design questions: