-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Robot 6.1rc1: Listener errors? #4786
Comments
I removed all the type hints so that there would be no question about it, and the issue still reproduces. There was no stack trace, and I remembered that there was a way to get more info, and sure enough: ROBOT_SYSLOG_FILE=robot_syslog.txt gave the stack trace. 20230607 20:43:02.644 | ERROR | Calling method 'start_suite' of listener 'RobotListener' failed: AttributeError: Protocol message SuiteResultsObject has no "_setter__suites" field. My code is marshaling the Robot results to my own grpc message object. @staticmethod
def copy_suite(grpc_msg,
suite,
result,
starting: bool) -> None:
"""Marshals the suite from Robot to grpc message
Args:
grpc_msg (_type_): output grpc message
suite (_running.model.TestSuite): input suite
result (_result.model.TestSuite): input result
starting (bool): is this a start command?
"""
grpc_msg.suite.name = suite.name
grpc_msg.suite.doc = suite.doc
# endtime is missing so we get an ERROR if we attempt...
_theslots = result.__slots__.copy()
if starting:
_theslots.remove('endtime')
for varname in _theslots:
setattr(grpc_msg.suite_result, varname, # line that causes the error
getattr(result, varname)) I am calling getattr() on the result object from within the listener. |
First is all, thanks for testing the rc! If I got it right, the error comes from |
Copying whatever is in |
Yes, but I do not mind because my objects are closely mirroring yours, and if you add new useful items to your Robot object, I would like to know about it so that I can add support for the new feature (or not). I should probably skip anything that starts with an underscore though... like these new items which are clearly internal use only. |
To clarify: adding the following code (which skips the new item) makes the issue go away: _theslots.remove('_setter__suites') |
We have an internal application that uses Robot Framework 6.0.2 and I was trying to test it with 6.1rc1 to ensure that everything still works. It looked OK but then I realized that the live feedback was missing, and then I went to the log and found this:
Test Execution Errors
Now, I noticed that in my listener I have used type hints to clarify what is going on:
Could that be the issue?
The text was updated successfully, but these errors were encountered: