Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Test inlining #12

Merged
merged 2 commits into from
Sep 13, 2013
Merged

Test inlining #12

merged 2 commits into from
Sep 13, 2013

Conversation

Valve
Copy link
Contributor

@Valve Valve commented Sep 13, 2013

Drawing analogy from sidekiq testing by inlining,
sidekiq-status allows to bypass redis and return a stubbed :complete status.
Since inlining your sidekiq worker will run it in-process, any exception it throws will make your test fail.
It will also run synchronously, so by the time you get to query the job status, the job will have been completed
successfully.
In other words, you'll get the :complete status only if the job didn't fail.

Inlining example:

You can run Sidekiq workers inline in your tests by requiring the sidekiq/testing/inline file in your {test,spec}_helper.rb:

require 'sidekiq/testing/inline'

To use sidekiq-status inlining, require it too in your {test,spec}_helper.rb:

require 'sidekiq-status/testing/inline'

@dkoprov
Copy link

dkoprov commented Sep 13, 2013

Useful feature, thanks!

@utgarda
Copy link
Owner

utgarda commented Sep 13, 2013

Thanks!

utgarda added a commit that referenced this pull request Sep 13, 2013
@utgarda utgarda merged commit bcf29cd into utgarda:master Sep 13, 2013
@Valve Valve deleted the test-inlining branch September 13, 2013 08:08
axos88 pushed a commit to axos88/sidekiq-status that referenced this pull request Jun 7, 2022
…precation-warnings

Fix redis deprecation warnings
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants