Repository navigation
Description
Currently long failure messages (over 40 lines by default, configurable with --max-error-lines (#2576)) are cut from the middle. This is done to avoid huge messages messing up logs and reports, but the problem is that some valuable information may be lost. Another issue is that even the resulting messages are somewhat long and take lot of space.
The above is an old problem, but the situation is getting worse in RF 7.0 due failure messages being shown not only with tests,but also with each keyword and control structure. Earlier keywords and control structures in the result model didn't have a message at all, but it was added as part of the result model cleanup (#4883). The motivation was this:
- We are adding JSON representation to the result model (Support JSON serialization with result model #4847) and want the model to be as stable and future-proof as possible.
- We likely want to in the future allow running individual keywords outside Robot core. At that point we want the result model to have a message, not only status as earlier.
- In some special cases (at least with
--flatten-keywordsand--remove-keywords) we want to add some extra notes to result objects. Earlier we used documentation for that, but it was odd because control structures such as FOR loops cannot otherwise have a documentation. Using the message for this purpose works much better.
Now that also keywords and control structures also have a message, the same message can be shown on multiple levels in the log file. That's rather annoying in general, but gets especially irritating if the message is long. To mitigate this issue, and to fix the old issue with long messages, I propose we do the following:
- Show only the beginning of long failure messages in log and report by default. I believe we should show so much that typical messages are shown fully, but considerably less than 40 lines that is the current maximum. We could possibly also show more with tests than with keywords and control structures.
- Have some way to show the full message. Probably a simple "Show more." button/link would be fine.
- Stop cutting long messages otherwise. This can increase output file sizes, but I doubt the difference is too big.
Activity
pekkaklarck commentedon Nov 6, 2023
If implementing this turns out to be too big a task in RF 7.0, we need to decide how to otherwise solve the issue with the same failure message being shown with tests, keywords and control structures in the log file. It would be easy to include the failure message only with tests, but then the extra notes added with
--flatten-keywordsand--remove-keywordswouldn't be shown either. Including only these extra notes could work, but parsing messages to find them would require some extra work.Don't add normal keyword or control structure messages to log.
pekkaklarck commentedon Nov 6, 2023
The above commit removed writing normal keyword and control structure messages to the log file. Only messages that are written are notes about keywords being removed or flattened with
--remove-keywordsor--flatten-keywords. This basically returns us to the situation we had before the result model cleanup (#4883).Collapsing long messages would still be convenient, but it doesn't have such a high priority. If it is done, we can consider including also keyword and control structure messages in the log file again. They may be annoying even if they are collapsed, though.
pekkaklarck commentedon Nov 13, 2023
As explained above, the situation is now the same as earlier. We are running out of time with RF 7.0 so moving this forward.