-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3014 Update how events are added to entity map to match specification #785
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
Conversation
@@ -226,7 +226,10 @@ def add_event(self, event): | |||
if event_name in self._event_types: | |||
super(EventListenerUtil, self).add_event(event) | |||
for id in self._event_mapping[event_name]: | |||
self.entity_map[id].append(str(event)) | |||
self.entity_map[id].append({ | |||
"name": type(event).__name__, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repr(event)
is better than just the type name because it includes the event name and other additional info (see the __repr__
methods in monitoring.py).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had it just use str(event). However,
if ('name' not in event) or (not event['name'].endswith('Event')):
self.fail("The workload executor didn't record event name as expected.")
This line from validator.py in drivers-atlas-testing seems to indicate that it expects it to just have the name, and no additional information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, in that case can we add a new field for the full event repr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Please fix these issues as well:
test_create_entities is opening clients and never closes them. |
No description provided.