-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Result model: Add message
to keywords and control structures and remove doc
from controls
#4883
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
Comments
Although there are changes to output.xml, this issue shouldn't cause backwards compatibility issues. We don't anymore write The new |
Although there shouldn't be direct backwards compatibility issues, output.xml size will grow because now failure messages are stored with all keywords and control structures, not only with tests. We don't expect the change to be noticeable unless there are big number of failures. If this causes issues in practice, we can consider making it configurable to store messages to output.xml. Even without such configuration, a simple pre-Rebot modifier with following content can clear all messages: def start_body_item(self, item):
item.message = '' |
The most visible change is that the failure message is visible with all keywords and control structures also in the log file. We are not sure is that desirable and may decide to hide it still before RF 7.0. Feedback related to that is appreciated! |
I guess the changes listed in the two comments above warrant adding |
Nowadays keywords and control structures have `message` (#4883). It should not be set with BREAK, CONTINUE and RETURN, though.
Based on my experience with using the current development version of Robot for testing Robot itself, I feel that showing the error message with all keywords and control structures in the log file doesn't work too well. Especially with longer errors and deeper nested structures it makes finding the actually failed keyword harder. It would be easy to not include message in the log file even though they are in the result model, but then extra information we add to the message at least with A somewhat easy solution would be showing only the beginning of the error with keywords and control structures. We could either cut it when the JS model used by the log file is constructed or we could have some JavaScript code that hides the message and allows viewing it fully if needed. The latter solution would be nice, but it's also more work and because the full message is anyway visible where it actually occurred it's not that important. |
Issue #4883 added `message` to keywords and control structures in the result model and they were also added to the log file. With nested structures, it is possible that multiple keywords or control structures have the same message that is also shared by the test case. This is somewhat annoying in general and especially problematic with longer messages. This commit removes 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-keywords` or `--flatten-keywords`. These notes are now wrapped with `<span class="robot-note"></span>` to make it possible to recognize them. Issue #4931 proposes collapsing long messages in log and report. If/when that's implemented, we can consider including also keyword and control structure messages in the log file.
Currently some control structures in the result model have a
doc
attribute that's represented in output.xml as a<doc>
element. This attribute is used for storing information about removing or flattening items using--flattenkeywords
and--removekeywords
options. It's a rather strange attribute because it's not possible to set documentation for control structures in data. It's also also inconsistent that only some of the control structures have it.On the other hand, control structures don't have a
message
attribute that would contain their possible failure message, they only havestatus
. Keywords have in practice don't havemessage
either. They do have the attribute, it is only used with teardowns to make possible to see the error message if a suite teardown fails.To fix the above issues, we have decided to do the following:
message
to all keywords and control structures and always store the possible failure message in it.message
also for storing information about flattening or removing items.doc
from control structures.The main benefit of these changes is making the result model simpler and more consistent. It is important in general, but it gets even more important now that we are adding JSON serialization support to it (#4847) and that format will likely be used also by external tools.
The
doc
attribute that control structures currently have won't be directly removed, but it will be deprecated as part of #4846. Old output.xml files with possible<doc>
elements with control structures will still be supported. Whatever content<doc>
contains will be added tomessage
.The text was updated successfully, but these errors were encountered: