-
Notifications
You must be signed in to change notification settings - Fork 1
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
Split TestHelpers
, one for JobHandler
and one for EventHandler
#72
Conversation
|
||
end | ||
|
||
class EventTestRunner < TestRunner |
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.
@jcredding we discussed you could just rename test runner as "job test runner and have the event test runner subclass. That job handler check shouldn't fail on event handlers since they bring job handler in.
@jcredding made a couple of comments. I'd like to take a second look and see how you choose to address them. |
72abd32
to
9feaab4
Compare
@kellyredding - I've updated this. I renamed the |
This splits the test helpers into two mixins, one for `JobHandler` and one for `EventHandler`. This is so each can provide a different `test_runner` method and in general, different test helpers as needed. This renames the `TestRunner` to `JobTestRunner` and adds an `EventTestRunner` that inherits from it. The `EventTestRunner` checks that its passed an `EventHandler` and also sets up passing an event job. `EventHandler`, unlike `JobHandler`, requires its runner to have an event job. To handle this, the `EventTestRunner` will build an event job and super it to the `TestRunner`. It also handles params so it can easily be passed event params directly. This also fixes a minor issue with how the `Runner` set its attributes and built its handler. Since event handlers require their runner to have an event job when they are built, the base `Runner` needs to set its attributes before it builds an instance of the handler. All of this is part of adding an events system to Qs.
9feaab4
to
d30ae4c
Compare
@jcredding very cool - I like it. 👎 |
Split `TestHelpers`, one for `JobHandler` and one for `EventHandler`
* Add `Event` (#67) * Add `EventHandler` mixin (#68) * Hotfix: Updating benchmark report to set new baseline (a3a88f5) * Add `dispatcher_queue` to Qs, setup for publishing events (#69) * Add payload type to jobs (#70) * Update `Event` to set a custom payload type (#73) * Add `Qs.publish` (#74) * Add `event` to `Queue` (#75) * Split `TestHelpers` (#72) * Store queues as event subscribers in redis (#76) * Add `Payload` module for serializing and deserializing (#78) * Add `Message`, setup `Event` being a kind of `Message` (#79) * Add `MessageHandler` (#80) * Update runners to expect a message (#81) * Update `Event` to be a kind of `Message` (#82) * Add optional publisher for events (#77) * Rename `RedisItem` to `QueueItem` (#83) * Pass params via options when building jobs and events (#84) * Add separate logging for jobs and events (#85) * Add `DispatchJobHandler` (#86) * Update dispatcher queue (#87) * Benchmark publishing and running events (#89) * Add daemon event handling system tests (#88) * Add subscription system tests, fix sync (#90) /cc @kellyredding
This splits the test helpers into two mixins, one for
JobHandler
and one for
EventHandler
. This is so each can provide a differenttest_runner
method and in general, different test helpers asneeded.
This renames the
TestRunner
toJobTestRunner
and adds anEventTestRunner
that inherits from it. TheEventTestRunner
checks that its passed an
EventHandler
and also sets up passingan event job.
EventHandler
, unlikeJobHandler
, requires itsrunner to have an event job. To handle this, the
EventTestRunner
will build an event job and super it to the
TestRunner
. It alsohandles params so it can easily be passed event params directly.
This also fixes a minor issue with how the
Runner
set itsattributes and built its handler. Since event handlers require
their runner to have an event job when they are built, the base
Runner
needs to set its attributes before it builds an instanceof the handler.
@kellyredding - Ready for review.