-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: emit error event #189
feat: emit error event #189
Conversation
07c4c84
to
4554f2c
Compare
4554f2c
to
57adf15
Compare
57adf15
to
a9b344d
Compare
('EXAM_ATTEMPT_ERRORED', ExamAttemptStatus.error, False) | ||
) | ||
@ddt.unpack | ||
def test_attempt_event_emitted(self, event_name, status, expect_requesting_user): |
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.
The diff for this is not displaying that well, but I combined all of the producer tests into one test. Each event is mocked, and then the status is updated.
""" | ||
Emit the EXAM_ATTEMPT_ERRORED Open edX event. | ||
""" | ||
user_data = UserData( |
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.
at some point (either this PR or later) we should probably make a helper function to create this object since it's always the same
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.
Created a helper function to create the UserData object
@@ -46,3 +51,17 @@ def listen_for_exam_attempt_rejected(sender, signal, **kwargs): # pylint: disab | |||
event_data={'exam_attempt': kwargs['exam_attempt']}, | |||
event_metadata=kwargs['metadata'], | |||
) | |||
|
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'd suggest just marking this entire file as pragma: no-cover
since this pattern of manual sends is temporary
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.
excluded this file from coverage by modifying .coveragerc
a9b344d
to
406283b
Compare
* feat: add openedx_events and edx_event_bus_kafka to INSTALLED_APPS * feat: install confluent_kafka[avro,schema-registry] for use with edx-event-bus-kafka * feat: add event bus and Kafka Django settings * feat: make User.full_name field non-nullable This commit makes the User.full_name field non-nullable to ensure that there is only one representation of the empty value - the empty string. Currently, empty values for this field can be either None or the empty string. Because we're transitioning from a nullable to non-nullable state, a default is required to handle existing rows with a null value. This is best practice; Django discourages setting both null=True and blank=True on CharField model fields. Furthermore, this was required by our event bus work. If an empty value is represented by None, this causes issues with the event bus, because None is not JSON serializable. Instead of converting a None value to the empty string in the event producer, correcting the the model definition is a better approach. * feat: upgrade openedx-events to 8.8.0 * feat: emit the EXAM_ATTEMPT_SUBMITTED Open edX event when an exam is submitted * feat: emit verified event for attempt (#186) * feat: emit rejected exam signal (#181) * feat: add errored event producer (#189) * chore: fix upgrades * chore: remove confluent-kafka import * docs: local event bus development * fix: remove local Kafka settings This commit removes Django settings from the local settings file, used by the local application server, related to setting up the Kafka implementation of the event bus. This is because the event bus does not work outside of a Docker container. This is because the event bus is run through the devstack networking layer, which is inaccessible by the local application server. * feat: update topic names for events (#193) * feat: exam reset producer (#196) send event to the event bus when an exam attempt is reset --------- Co-authored-by: michaelroytman <[email protected]> Co-authored-by: Michael Roytman <[email protected]> Co-authored-by: Zachary Hancock <[email protected]>
JIRA: MST-2115
Description: If an attempt's status is updated to
error
, emit an open edx event to be consumed by the event bus.Merge checklist:
Post merge: